From 18abb2481dbff7796569fa8d3687ecb161cc5737 Mon Sep 17 00:00:00 2001 From: Aimee Sutton Date: Tue, 9 Feb 2021 11:45:03 -0500 Subject: [PATCH 1/9] Changes to support regressions triggered by PRs --- .github/workflows/metrics-regress.yml | 1 + scripts/metrics-regress.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/metrics-regress.yml b/.github/workflows/metrics-regress.yml index 2efccf95..aa23ea3d 100644 --- a/.github/workflows/metrics-regress.yml +++ b/.github/workflows/metrics-regress.yml @@ -22,5 +22,6 @@ jobs: METRICS_CI_TOKEN: ${{ secrets.METRICS_CI_TOKEN }} METRICS_REGRESSION_NAME: riscv-dv_regression METRICS_PROJECT_ID: ${{ secrets.METRICS_PROJECT_ID }} + PR_NUMBER: ${{ github.event.pull_request.number }} shell: bash diff --git a/scripts/metrics-regress.py b/scripts/metrics-regress.py index 303fa9e6..192f8787 100755 --- a/scripts/metrics-regress.py +++ b/scripts/metrics-regress.py @@ -39,7 +39,13 @@ def make_http_request( req_type, endpoint, params=None ): ## Start regression reqParams = {} reqParams['regressionName'] = args.regressionName -reqParams['branch'] = str(os.environ['GITHUB_REF']) + +# Determine the git reference to pass to Metrics. For PRs, the reference +# is of the format /refs/pull//merge +if str(os.environ['GITHUB_EVENT_NAME']) eq 'pull_request_target': + reqParams['branch'] = '/refs/pull/' + str(os.environ['PR_NUMBER']) + '/merge' +else: + reqParams['branch'] = str(os.environ['GITHUB_REF']) params = json.dumps(reqParams) response, regressionData = make_http_request('POST', postRegression, params) From 18e79bd6de97211760bb2bca7d823d25bf599e38 Mon Sep 17 00:00:00 2001 From: Aimee Sutton Date: Tue, 9 Feb 2021 11:52:07 -0500 Subject: [PATCH 2/9] Removed tab, inserted spaces --- .github/workflows/metrics-regress.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/metrics-regress.yml b/.github/workflows/metrics-regress.yml index aa23ea3d..6829837f 100644 --- a/.github/workflows/metrics-regress.yml +++ b/.github/workflows/metrics-regress.yml @@ -22,6 +22,6 @@ jobs: METRICS_CI_TOKEN: ${{ secrets.METRICS_CI_TOKEN }} METRICS_REGRESSION_NAME: riscv-dv_regression METRICS_PROJECT_ID: ${{ secrets.METRICS_PROJECT_ID }} - PR_NUMBER: ${{ github.event.pull_request.number }} + PR_NUMBER: ${{ github.event.pull_request.number }} shell: bash From b97406081cd1b21a15ca130444bf7b8bfa252625 Mon Sep 17 00:00:00 2001 From: Aimee Sutton Date: Tue, 9 Feb 2021 11:56:11 -0500 Subject: [PATCH 3/9] More fixes to work with PRs --- .github/workflows/metrics-regress.yml | 2 +- scripts/metrics-regress.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/metrics-regress.yml b/.github/workflows/metrics-regress.yml index 6829837f..d0ef92f4 100644 --- a/.github/workflows/metrics-regress.yml +++ b/.github/workflows/metrics-regress.yml @@ -7,7 +7,7 @@ name: metrics-regress on: push: branches: [ master ] - pull_request: + pull_request_target: branches: [ master ] # If you fork this repository, you must create a new Metrics project for your fork diff --git a/scripts/metrics-regress.py b/scripts/metrics-regress.py index 192f8787..253544aa 100755 --- a/scripts/metrics-regress.py +++ b/scripts/metrics-regress.py @@ -42,7 +42,7 @@ def make_http_request( req_type, endpoint, params=None ): # Determine the git reference to pass to Metrics. For PRs, the reference # is of the format /refs/pull//merge -if str(os.environ['GITHUB_EVENT_NAME']) eq 'pull_request_target': +if str(os.environ['GITHUB_EVENT_NAME']) is 'pull_request_target': reqParams['branch'] = '/refs/pull/' + str(os.environ['PR_NUMBER']) + '/merge' else: reqParams['branch'] = str(os.environ['GITHUB_REF']) From ad358c35c8e992cf96d6d1a3451cb681e498eb53 Mon Sep 17 00:00:00 2001 From: Aimee Sutton Date: Tue, 9 Feb 2021 16:05:29 -0500 Subject: [PATCH 4/9] Change target of regression to Metrics nightly cluster --- scripts/metrics-regress.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/metrics-regress.py b/scripts/metrics-regress.py index 253544aa..faf479b4 100755 --- a/scripts/metrics-regress.py +++ b/scripts/metrics-regress.py @@ -30,7 +30,7 @@ def make_http_request( req_type, endpoint, params=None ): args = parser.parse_args() ## Server -server = 'chipsalliance.metrics.ca:443' +server = 'nightly.metrics.ca:443' ## API Endpoints postRegression = '/api/v1/projects/'+args.projectId+'/regressionRuns' From ddf9ce1dc73fb76e7899690f185abf82960d4d02 Mon Sep 17 00:00:00 2001 From: Aimee Sutton Date: Tue, 9 Feb 2021 16:05:50 -0500 Subject: [PATCH 5/9] Change target of regression to Metrics nightly cluster --- scripts/metrics-regress.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/metrics-regress.py b/scripts/metrics-regress.py index faf479b4..43fdd637 100755 --- a/scripts/metrics-regress.py +++ b/scripts/metrics-regress.py @@ -103,7 +103,7 @@ def make_http_request( req_type, endpoint, params=None ): # print('Code (block): ' + str(math.trunc(regressionData['lineCoverage']*100) /100)) #print('\n') -print('Full results at: https://chipsalliance.metrics.ca/' + args.projectId + \ +print('Full results at: https://nightly.metrics.ca/' + args.projectId + \ '/results/regressionRuns/' + regressionRunId) ## Set the exit code to be used by github action From 53c08db6f6a57d001c5c361dfea8e0b75751d05c Mon Sep 17 00:00:00 2001 From: Aimee Sutton Date: Tue, 9 Feb 2021 16:52:43 -0500 Subject: [PATCH 6/9] Updated ENV variables for new risc-v toolchain --- .metrics.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.metrics.json b/.metrics.json index 7b688cb5..0357f615 100644 --- a/.metrics.json +++ b/.metrics.json @@ -2,8 +2,8 @@ "variables": { "DSIM" : "${DSIM_HOME}/bin/dsim", "DSIM_LIB_PATH" : "${DSIM_HOME}/uvm-1.2/src/dpi", - "RISCV_GCC" : "${RISCV_TOOLCHAIN}/bin/riscv-none-embed-gcc", - "RISCV_OBJCOPY" : "${RISCV_TOOLCHAIN}/bin/riscv-none-embed-objcopy", + "RISCV_GCC" : "${RISCV_TOOLCHAIN}/bin/riscv-unknown-elf-gcc", + "RISCV_OBJCOPY" : "${RISCV_TOOLCHAIN}/bin/riscv-unknown-elf-objcopy", "OVPSIM_PATH" : "/customer-tools/riscv-ovpsim/bin/Linux64" }, "builds": { From 4e74455881e9e31de94ec6fecfe9521989919cac Mon Sep 17 00:00:00 2001 From: Aimee Sutton Date: Tue, 9 Feb 2021 17:05:04 -0500 Subject: [PATCH 7/9] Updated ENV variables for new risc-v toolchain - fix typo --- .metrics.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.metrics.json b/.metrics.json index 0357f615..de76f62c 100644 --- a/.metrics.json +++ b/.metrics.json @@ -2,8 +2,8 @@ "variables": { "DSIM" : "${DSIM_HOME}/bin/dsim", "DSIM_LIB_PATH" : "${DSIM_HOME}/uvm-1.2/src/dpi", - "RISCV_GCC" : "${RISCV_TOOLCHAIN}/bin/riscv-unknown-elf-gcc", - "RISCV_OBJCOPY" : "${RISCV_TOOLCHAIN}/bin/riscv-unknown-elf-objcopy", + "RISCV_GCC" : "${RISCV_TOOLCHAIN}/bin/riscv32-unknown-elf-gcc", + "RISCV_OBJCOPY" : "${RISCV_TOOLCHAIN}/bin/riscv32-unknown-elf-objcopy", "OVPSIM_PATH" : "/customer-tools/riscv-ovpsim/bin/Linux64" }, "builds": { From 6ac38d2c219cc937f271b247f59c38c272c32249 Mon Sep 17 00:00:00 2001 From: metrics-qa <72212406+metrics-qa@users.noreply.github.com> Date: Wed, 10 Feb 2021 16:04:37 -0500 Subject: [PATCH 8/9] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 232b05e1..4bf41c8d 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ qrun.log riscv_dv.egg-info pygen/pygen_src/test/out/* !.gitkeep +*.trivialChange From efc80d87a712bd38886567346c5760f5d85b6e2e Mon Sep 17 00:00:00 2001 From: metrics-qa <72212406+metrics-qa@users.noreply.github.com> Date: Thu, 11 Feb 2021 14:00:14 -0500 Subject: [PATCH 9/9] Create testFile --- testFile | 1 + 1 file changed, 1 insertion(+) create mode 100644 testFile diff --git a/testFile b/testFile new file mode 100644 index 00000000..30f21dd6 --- /dev/null +++ b/testFile @@ -0,0 +1 @@ +blah blah