Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit fa17070

Browse files
author
Hendrik van Antwerpen
committed
Ensure env variables are available to summary job
1 parent fcc9a77 commit fa17070

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed

.github/workflows/perf.yml

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,20 @@ on:
44
paths:
55
- 'stack-graphs/**'
66
env:
7-
TEST_REPO: microsoft/TypeScript
8-
TEST_REF: v4.9.5
9-
TEST_DIR: test
10-
TEST_SRC: src/compiler
7+
BASE_REPO: ${{ github.event.pull_request.base.repo.owner.login }}/${{ github.event.pull_request.base.repo.name }}
8+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
119
BASE_MASSIF_OUT: base-perf.out
1210
BASE_REPORT: base-perf.txt
1311
BASE_ARTIFACT: base-perf-results
12+
HEAD_REPO: ${{ github.event.pull_request.head.repo.owner.login }}/${{ github.event.pull_request.head.repo.name }}
13+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
1414
HEAD_MASSIF_OUT: head-perf.out
1515
HEAD_REPORT: head-perf.txt
1616
HEAD_ARTIFACT: head-perf-results
17+
TEST_REPO: microsoft/TypeScript
18+
TEST_REF: v4.9.5
19+
TEST_DIR: test
20+
TEST_SRC: src/compiler
1721
TSSG_TS: tree-sitter-stack-graphs-typescript
1822

1923
jobs:
@@ -23,8 +27,6 @@ jobs:
2327
base-perf:
2428
runs-on: ubuntu-latest
2529
env:
26-
BASE_REPO: ${{ github.event.pull_request.base.repo.owner.login }}/${{ github.event.pull_request.base.repo.name }}
27-
BASE_SHA: ${{ github.event.pull_request.base.sha }}
2830
BASE_DIR: base
2931
steps:
3032
#
@@ -45,6 +47,15 @@ jobs:
4547
sudo apt-get update
4648
sudo apt-get install -y valgrind
4749
#
50+
# Checkout code
51+
#
52+
- name: "Checkout base code"
53+
uses: actions/checkout@v3
54+
with:
55+
repository: ${{ env.BASE_REPO }}
56+
ref: ${{ env.BASE_SHA }}
57+
path: ${{ env.BASE_DIR }}
58+
#
4859
# Cache results
4960
#
5061
- name: "Cache base result"
@@ -56,13 +67,6 @@ jobs:
5667
#
5768
# Build code
5869
#
59-
- name: "Checkout base code"
60-
if: steps.cache-base-result.outputs.cache-hit != 'true'
61-
uses: actions/checkout@v3
62-
with:
63-
repository: ${{ env.BASE_REPO }}
64-
ref: ${{ env.BASE_SHA }}
65-
path: ${{ env.BASE_DIR }}
6670
- name: "Build base CLI"
6771
if: steps.cache-base-result.outputs.cache-hit != 'true'
6872
run: cargo build --package ${{ env.TSSG_TS }} --features cli --release
@@ -104,8 +108,6 @@ jobs:
104108
head-perf:
105109
runs-on: ubuntu-latest
106110
env:
107-
HEAD_REPO: ${{ github.event.pull_request.head.repo.owner.login }}/${{ github.event.pull_request.head.repo.name }}
108-
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
109111
HEAD_DIR: head
110112
steps:
111113
#
@@ -126,6 +128,15 @@ jobs:
126128
sudo apt-get update
127129
sudo apt-get install -y valgrind
128130
#
131+
# Checkout code
132+
#
133+
- name: "Checkout head code"
134+
uses: actions/checkout@v3
135+
with:
136+
repository: ${{ env.HEAD_REPO }}
137+
ref: ${{ env.HEAD_SHA }}
138+
path: ${{ env.HEAD_DIR }}
139+
#
129140
# Cache results
130141
#
131142
- name: "Cache head result"
@@ -137,13 +148,6 @@ jobs:
137148
#
138149
# Build code
139150
#
140-
- name: "Checkout head code"
141-
if: steps.cache-head-result.outputs.cache-hit != 'true'
142-
uses: actions/checkout@v3
143-
with:
144-
repository: ${{ env.HEAD_REPO }}
145-
ref: ${{ env.HEAD_SHA }}
146-
path: ${{ env.HEAD_DIR }}
147151
- name: "Build head CLI"
148152
if: steps.cache-head-result.outputs.cache-hit != 'true'
149153
run: cargo build --package ${{ env.TSSG_TS }} --features cli --release

0 commit comments

Comments
 (0)