Skip to content

Commit 708a422

Browse files
committed
Fix determinism workflow
1 parent 07634cc commit 708a422

1 file changed

Lines changed: 29 additions & 18 deletions

File tree

.github/workflows/determinism.yaml

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
include:
16-
- os: macos-latest
17-
work_dir: ${{ env.RUNNER_TEMP }}/r
18-
- os: ubuntu-latest
19-
work_dir: ${{ env.RUNNER_TEMP }}/r
20-
- os: windows-latest
21-
work_dir: C:\r
15+
os:
16+
- macos-latest
17+
- ubuntu-latest
18+
- ubuntu-latest-arm
19+
- windows-latest
2220

2321
runs-on: ${{ matrix.os }}
2422
name: Check (${{ matrix.os }})
@@ -28,15 +26,28 @@ jobs:
2826
with:
2927
clean: true
3028

29+
- name: Choose a work directory (unix)
30+
if: runner.os != 'Windows'
31+
shell: bash
32+
run: |
33+
echo "WORK_DIR=$RUNNER_TEMP/r" >> "$GITHUB_ENV"
34+
35+
- name: Choose a work directory (windows)
36+
if: runner.os == 'Windows'
37+
shell: pwsh
38+
run: |
39+
"WORK_DIR=C:\r" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
40+
3141
- name: Run tests
3242
continue-on-error: true
33-
run: |
34-
bazel run \
35-
--compilation_mode=opt \
36-
//test/determinism:tester \
37-
-- test \
38-
--output="${{ github.workspace }}/results.json" \
39-
--work-dir="${{ matrix.work_dir }}"
43+
run: >-
44+
bazel run
45+
--compilation_mode=opt
46+
//test/determinism:tester
47+
--
48+
test
49+
--output="${{ github.workspace }}/results.json"
50+
--work-dir="${WORK_DIR}"
4051
4152
- name: Summarize (unix)
4253
if: runner.os != 'Windows'
@@ -83,16 +94,16 @@ jobs:
8394
if: runner.os != 'Windows' && always()
8495
shell: bash
8596
run: |
86-
if [[ -d "${{ matrix.work_dir }}/o" ]]; then
87-
tar -czf output-base.tar.gz -C "${{ matrix.work_dir }}" o
97+
if [[ -d "${WORK_DIR}/o" ]]; then
98+
tar -czf output-base.tar.gz -C "${WORK_DIR}" o
8899
fi
89100
90101
- name: Archive output base (windows)
91102
if: runner.os == 'Windows' && always()
92103
shell: pwsh
93104
run: |
94-
if (Test-Path "${{ matrix.work_dir }}\o") {
95-
Compress-Archive -Path "${{ matrix.work_dir }}\o" -DestinationPath output-base.zip
105+
if (Test-Path "$env:WORK_DIR\o") {
106+
Compress-Archive -Path "$env:WORK_DIR\o" -DestinationPath output-base.zip
96107
}
97108
98109
- name: Upload output base artifact

0 commit comments

Comments
 (0)