Skip to content

Commit f311b70

Browse files
authored
Fix environment variables (#21)
1 parent 1391889 commit f311b70

File tree

4 files changed

+38
-12
lines changed

4 files changed

+38
-12
lines changed

.github/scripts/extract_matrix.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ def system_packages(self) -> list[str]:
110110
# TODO: support more packages
111111
system_packages = []
112112
for k, _ in self.job.get("packages", {}).items():
113+
if k in ["mx", "python3"]:
114+
continue
113115
if k.startswith("pip:"):
114116
continue
115117
elif k.startswith("00:") or k.startswith("01:"):

.github/workflows/ci-matrix-gen.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ on:
1313
required: true
1414
type: string
1515

16-
schedule:
17-
- cron: '0 0 * * 1'
18-
1916
jobs:
2017
generate-tier1:
2118
runs-on: ubuntu-latest
@@ -58,13 +55,36 @@ jobs:
5855
tier1:
5956
needs: generate-tier1
6057
runs-on: ${{ matrix.os }}
61-
env: ${{ matrix.env }}
58+
#env: ${{ matrix.env }}
6259
strategy:
6360
fail-fast: false
6461
matrix:
6562
include: ${{ fromJson(needs.generate-tier1.outputs.matrix) }}
6663
steps: &buildsteps
6764

65+
- name: Setup env
66+
shell: bash
67+
if: runner.os != 'Windows'
68+
run: |
69+
matrix_env='${{ toJson(matrix.env) }}'
70+
echo $matrix_env | jq -r 'to_entries[] | "\(.key)=\(.value)"' >> tmp.env
71+
while IFS= read -r line; do
72+
eval "echo \"$line\"" >> $GITHUB_ENV
73+
done < tmp.env
74+
rm tmp.env
75+
76+
- name: Setup env (Windows)
77+
if: runner.os == 'Windows'
78+
shell: pwsh
79+
run: |
80+
$matrix_env = '${{ toJson(matrix.env) }}'
81+
$envs = $matrix_env | ConvertFrom-Json
82+
foreach ($pair in $envs.PSObject.Properties) {
83+
$full_value = $pair.Value -replace '%([A-Za-z0-9_]+)%', '$env:$1'
84+
$value = $ExecutionContext.InvokeCommand.ExpandString($full_value)
85+
"$($pair.Name)=$value" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
86+
}
87+
6888
- name: Actions/Checkout
6989
uses: actions/checkout@main
7090
with:
@@ -250,7 +270,7 @@ jobs:
250270
if: ${{ success() || inputs.jobs_to_run }}
251271
needs: [generate-tier2, tier1]
252272
runs-on: ${{ matrix.os }}
253-
env: ${{ matrix.env }}
273+
#env: ${{ matrix.env }}
254274
strategy:
255275
fail-fast: false
256276
matrix:
@@ -261,7 +281,7 @@ jobs:
261281
if: ${{ success() || inputs.jobs_to_run }}
262282
needs: [generate-tier3, tier2]
263283
runs-on: ${{ matrix.os }}
264-
env: ${{ matrix.env }}
284+
#env: ${{ matrix.env }}
265285
strategy:
266286
fail-fast: false
267287
matrix:

.github/workflows/ci-unittest-retagger.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,18 @@ jobs:
1919
run-retagger:
2020
if: success()
2121
needs: build-standalone-artifacts
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
target: [linux-amd64, linux-aarch64, windows-amd64]
2226
uses: ./.github/workflows/ci-matrix-gen.yml
27+
name: Run retagger on ${{ matrix.target }}
2328
with:
24-
jobs_to_run: ${{ github.event.inputs.jobs_to_run || 'python-unittest-retagger' }}
29+
jobs_to_run: ${{ github.event.inputs.jobs_to_run || format('^python-unittest-retagger.*{0}.*', matrix.target) }}
2530

2631
merge_all_reports:
2732
runs-on: ubuntu-latest
2833
needs: run-retagger
29-
if: ${{ success() }}
3034
env:
3135
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3236
steps:
@@ -59,7 +63,7 @@ jobs:
5963
working-directory: main
6064
run: |
6165
mkdir -p ../retagger-reports ../diffs
62-
mv retagger-report*.json ../retagger-reports
66+
mv retagger-report*.json ../retagger-reports || true
6367
6468
declare -a os_list=("linux-x86_64" "linux-aarch64" "win32-AMD64")
6569
for os in "${os_list[@]}"; do

ci/python-gate.libsonnet

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,14 @@
151151
darwin: {
152152
common: ENV_POSIX + {
153153
LC_CTYPE: "en_US.UTF-8",
154-
PATH: utils.path_combine(ENVIRONMENT.common.PATH, "$PYTHON3_HOME:$MUSL_TOOLCHAIN/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/homebrew/bin:/opt/homebrew/sbin"),
154+
PATH: utils.path_combine(ENVIRONMENT.common.PATH, "$PATH:$PYTHON3_HOME:$MUSL_TOOLCHAIN/bin"),
155155
},
156156
amd64: {},
157157
aarch64: {},
158158
},
159159
windows: {
160160
common: {
161-
PATH: "$PATH;C:\\ProgramData\\chocolatey\\bin;C:\\hostedtoolcache\\windows\\Python\\3.12.3\\x64\\Scripts;C:\\hostedtoolcache\\windows\\Python\\3.12.3\\x64;C:\\Program Files\\PowerShell\\7;C:\\windows\\system32;C:\\windows;C:\\windows\\System32\\Wbem;C:\\windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\windows\\System32\\OpenSSH\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\Microsoft SQL Server\\150\\Tools\\Binn\\;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Git\\usr\\bin;C:\\hostedtoolcache\\windows\\Ruby\\3.2.3\\x64\\bin;C:\\hostedtoolcache\\windows\\Go\\1.22.2\\x64\\bin;C:\\hostedtoolcache\\windows\\Node\\20.11.1\\x64\\;C:\\npm\\prefix;C:\\Program Files\\Amazon\\AWSCLIV2\\;C:\\Program Files\\Amazon\\SessionManagerPlugin\\bin\\;C:\\Program Files\\LLVM\\bin;C:\\Program Files\\CMake\\bin;C:\\Program Files\\OpenSSL\\bin;C:\\msys64\\usr\\bin;C:\\hostedtoolcache\\windows\\php\\8.2.15\\x64;C:\\Program Files\\Azure DevOps CLI\\bin;C:\\hostedtoolcache\\windows\\R\\4.3.3\\x64\\bin;C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\Extensions\\Microsoft\\NuGet;",
161+
PATH: "%MAVEN_HOME%;%PATH%",
162162
},
163163
amd64: {},
164164
aarch64: {},
@@ -170,7 +170,7 @@
170170
LD_LIBRARY_PATH: "$LIBGMP/lib:$LLVM/lib:$LD_LIBRARY_PATH",
171171
FORK_COUNTS_DIRECTORY: "$BUILD_DIR/benchmarking-config/fork-counts",
172172
RODINIA_DATASET_ZIP: $.overlay_imports.RODINIA_DATASET_ZIP,
173-
PATH: utils.path_combine(ENVIRONMENT.common.PATH, "$PYTHON3_HOME:$MUSL_TOOLCHAIN/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"),
173+
PATH: utils.path_combine(ENVIRONMENT.common.PATH, "$PATH:$PYTHON3_HOME:$MUSL_TOOLCHAIN/bin"),
174174
},
175175

176176
// This is the diff to 'ENVIRONMENT' and meant to be used on OL8 images.

0 commit comments

Comments
 (0)