Skip to content

Commit e6ac9d5

Browse files
authored
Fix determinism workflow (bazelbuild#3933)
The workflow currently is broken due to bazelbuild#3904 being incomplete. This fixes it.
1 parent 4be4fbe commit e6ac9d5

1 file changed

Lines changed: 54 additions & 23 deletions

File tree

.github/workflows/determinism.yaml

Lines changed: 54 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,22 @@ name: Determinism
22

33
on:
44
workflow_dispatch:
5-
pull_request:
6-
types: [opened, synchronize]
7-
paths:
8-
- test/determinism/**
5+
inputs:
6+
commit:
7+
description: "Git commit or branch to test (defaults to main)"
8+
required: false
9+
default: "main"
910

1011
jobs:
1112
check:
1213
strategy:
1314
fail-fast: false
1415
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
16+
os:
17+
- macos-latest
18+
- ubuntu-latest
19+
- ubuntu-24.04-arm
20+
- windows-latest
2221

2322
runs-on: ${{ matrix.os }}
2423
name: Check (${{ matrix.os }})
@@ -28,15 +27,47 @@ jobs:
2827
with:
2928
clean: true
3029

31-
- name: Run tests
32-
continue-on-error: true
30+
- name: Choose a work directory (unix)
31+
if: runner.os != 'Windows'
32+
shell: bash
33+
run: |
34+
echo "WORK_DIR=$RUNNER_TEMP/r" >> "$GITHUB_ENV"
35+
36+
- name: Choose a work directory (windows)
37+
if: runner.os == 'Windows'
38+
shell: pwsh
3339
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 }}"
40+
'WORK_DIR=C:\r' | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
41+
42+
- name: Run tests (unix)
43+
if: runner.os != 'Windows'
44+
continue-on-error: true
45+
shell: bash
46+
run: >-
47+
bazel run
48+
--compilation_mode=opt
49+
//test/determinism:tester
50+
--
51+
test
52+
--url=${{ format('{0}/{1}.git', github.server_url, github.repository) }}
53+
--commit=${{ inputs.commit }}
54+
--output="${{ github.workspace }}/results.json"
55+
--work-dir="${WORK_DIR}"
56+
57+
- name: Run tests (windows)
58+
if: runner.os == 'Windows'
59+
continue-on-error: true
60+
shell: pwsh
61+
run: >-
62+
bazel run
63+
--compilation_mode=opt
64+
//test/determinism:tester
65+
'--'
66+
test
67+
--url=${{ format('{0}/{1}.git', github.server_url, github.repository) }}
68+
--commit=${{ inputs.commit }}
69+
--output="${{ github.workspace }}/results.json"
70+
--work-dir="$env:WORK_DIR"
4071
4172
- name: Summarize (unix)
4273
if: runner.os != 'Windows'
@@ -83,16 +114,16 @@ jobs:
83114
if: runner.os != 'Windows' && always()
84115
shell: bash
85116
run: |
86-
if [[ -d "${{ matrix.work_dir }}/o" ]]; then
87-
tar -czf output-base.tar.gz -C "${{ matrix.work_dir }}" o
117+
if [[ -d "${WORK_DIR}/o" ]]; then
118+
tar -czf output-base.tar.gz -C "${WORK_DIR}" o
88119
fi
89120
90121
- name: Archive output base (windows)
91122
if: runner.os == 'Windows' && always()
92123
shell: pwsh
93124
run: |
94-
if (Test-Path "${{ matrix.work_dir }}\o") {
95-
Compress-Archive -Path "${{ matrix.work_dir }}\o" -DestinationPath output-base.zip
125+
if (Test-Path "$env:WORK_DIR\o") {
126+
Compress-Archive -Path "$env:WORK_DIR\o" -DestinationPath output-base.zip
96127
}
97128
98129
- name: Upload output base artifact

0 commit comments

Comments
 (0)