Skip to content

Commit 232d465

Browse files
authored
ci: only allow one set of jobs per PR (#7958)
1 parent 5d14f33 commit 232d465

File tree

7 files changed

+99
-50
lines changed

7 files changed

+99
-50
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ env:
4646
CACHE_SUFFIX: d # cache busting
4747
WGPU_CI: true
4848

49+
# Every time a PR is pushed to, cancel any previous jobs. This
50+
# makes us behave nicer to github and get faster turnaround times
51+
# on PRs that are pushed to multiple times in rapid succession.
52+
concurrency:
53+
group: ${{github.workflow}}-${{github.ref}}
54+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
55+
4956
# We distinguish the following kinds of builds:
5057
# - native: build for the same target as we compile on
5158
# - web: build for the Web

.github/workflows/cts.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ env:
1313
RUST_BACKTRACE: full
1414
MSRV: "1.88"
1515

16+
# Every time a PR is pushed to, cancel any previous jobs. This
17+
# makes us behave nicer to github and get faster turnaround times
18+
# on PRs that are pushed to multiple times in rapid succession.
19+
concurrency:
20+
group: ${{github.workflow}}-${{github.ref}}
21+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
22+
1623
jobs:
1724
cts:
1825
strategy:

.github/workflows/docs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ env:
1616
CARGO_TERM_COLOR: always
1717
RUST_BACKTRACE: full
1818

19+
# Every time a PR is pushed to, cancel any previous jobs. This
20+
# makes us behave nicer to github and get faster turnaround times
21+
# on PRs that are pushed to multiple times in rapid succession.
22+
concurrency:
23+
group: ${{github.workflow}}-${{github.ref}}
24+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
25+
1926
jobs:
2027
build:
2128
runs-on: ubuntu-latest

.github/workflows/generate.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ env:
1616
REPO_MSRV: "1.88"
1717
RUSTFLAGS: -D warnings
1818

19+
# Every time a PR is pushed to, cancel any previous jobs. This
20+
# makes us behave nicer to github and get faster turnaround times
21+
# on PRs that are pushed to multiple times in rapid succession.
22+
concurrency:
23+
group: ${{github.workflow}}-${{github.ref}}
24+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
25+
1926
jobs:
2027
cargo-generate:
2128
timeout-minutes: 5

.github/workflows/lazy.yml

Lines changed: 56 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Lazy
33
on:
44
pull_request:
55
paths:
6-
- '.github/workflows/lazy.yml'
6+
- ".github/workflows/lazy.yml"
77
push:
88
branches: [trunk]
99

@@ -12,6 +12,13 @@ env:
1212
CARGO_TERM_COLOR: always
1313
RUST_BACKTRACE: full
1414

15+
# Every time a PR is pushed to, cancel any previous jobs. This
16+
# makes us behave nicer to github and get faster turnaround times
17+
# on PRs that are pushed to multiple times in rapid succession.
18+
concurrency:
19+
group: ${{github.workflow}}-${{github.ref}}
20+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
21+
1522
jobs:
1623
parse-dota2:
1724
name: "Validate Shaders: Dota2"
@@ -98,58 +105,58 @@ jobs:
98105
99106
- name: Compile `spv` from `spvasm`
100107
run: |
101-
cd naga/spirv-samples
102-
mkdir -p spv
108+
cd naga/spirv-samples
109+
mkdir -p spv
103110
104-
find "./spvasm" -name '*.spvasm' | while read fname;
105-
do
106-
echo "Convert to spv with spirv-as: $fname"
107-
../install/bin/spirv-as --target-env spv1.3 $(realpath ${fname}) -o ./spv/$(basename ${fname}).spv
108-
done;
111+
find "./spvasm" -name '*.spvasm' | while read fname;
112+
do
113+
echo "Convert to spv with spirv-as: $fname"
114+
../install/bin/spirv-as --target-env spv1.3 $(realpath ${fname}) -o ./spv/$(basename ${fname}).spv
115+
done;
109116
110117
- name: Validate `spv` and generate `wgsl`
111118
run: |
112-
set +e
113-
cd naga/spirv-samples
114-
SUCCESS_RESULT_COUNT=0
115-
FILE_COUNT=0
116-
mkdir -p spv
117-
mkdir -p wgsl
118-
119-
echo "==== Validate spv and generate wgsl ===="
120-
rm -f counter
121-
touch counter
122-
123-
find "./spv" -name '*.spv' | while read fname;
124-
do
125-
echo "Convert: $fname"
126-
FILE_COUNT=$((FILE_COUNT+1))
127-
../../target/release/naga --validate 27 $(realpath ${fname}) ./wgsl/$(basename ${fname}).wgsl
128-
if [[ $? -eq 0 ]]; then
129-
SUCCESS_RESULT_COUNT=$((SUCCESS_RESULT_COUNT + 1))
130-
fi
131-
echo "Result: $(expr $FILE_COUNT - $SUCCESS_RESULT_COUNT) / $FILE_COUNT" > counter
132-
done
133-
cat counter
119+
set +e
120+
cd naga/spirv-samples
121+
SUCCESS_RESULT_COUNT=0
122+
FILE_COUNT=0
123+
mkdir -p spv
124+
mkdir -p wgsl
125+
126+
echo "==== Validate spv and generate wgsl ===="
127+
rm -f counter
128+
touch counter
129+
130+
find "./spv" -name '*.spv' | while read fname;
131+
do
132+
echo "Convert: $fname"
133+
FILE_COUNT=$((FILE_COUNT+1))
134+
../../target/release/naga --validate 27 $(realpath ${fname}) ./wgsl/$(basename ${fname}).wgsl
135+
if [[ $? -eq 0 ]]; then
136+
SUCCESS_RESULT_COUNT=$((SUCCESS_RESULT_COUNT + 1))
137+
fi
138+
echo "Result: $(expr $FILE_COUNT - $SUCCESS_RESULT_COUNT) / $FILE_COUNT" > counter
139+
done
140+
cat counter
134141
135142
- name: Validate output `wgsl`
136143
run: |
137-
set +e
138-
cd naga/spirv-samples
139-
SUCCESS_RESULT_COUNT=0
140-
FILE_COUNT=0
141-
142-
rm -f counter
143-
touch counter
144-
145-
find "./wgsl" -name '*.wgsl' | while read fname;
146-
do
147-
echo "Validate: $fname"
148-
FILE_COUNT=$((FILE_COUNT+1))
149-
../../target/release/naga --validate 27 $(realpath ${fname})
150-
if [[ $? -eq 0 ]]; then
151-
SUCCESS_RESULT_COUNT=$((SUCCESS_RESULT_COUNT + 1))
152-
fi
153-
echo "Result: $(expr $FILE_COUNT - $SUCCESS_RESULT_COUNT) / $FILE_COUNT" > counter
154-
done
155-
cat counter
144+
set +e
145+
cd naga/spirv-samples
146+
SUCCESS_RESULT_COUNT=0
147+
FILE_COUNT=0
148+
149+
rm -f counter
150+
touch counter
151+
152+
find "./wgsl" -name '*.wgsl' | while read fname;
153+
do
154+
echo "Validate: $fname"
155+
FILE_COUNT=$((FILE_COUNT+1))
156+
../../target/release/naga --validate 27 $(realpath ${fname})
157+
if [[ $? -eq 0 ]]; then
158+
SUCCESS_RESULT_COUNT=$((SUCCESS_RESULT_COUNT + 1))
159+
fi
160+
echo "Result: $(expr $FILE_COUNT - $SUCCESS_RESULT_COUNT) / $FILE_COUNT" > counter
161+
done
162+
cat counter

.github/workflows/publish.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Publish
33
on:
44
pull_request:
55
paths:
6-
- '.github/workflows/publish.yml'
6+
- ".github/workflows/publish.yml"
77
push:
88
branches:
99
- trunk
@@ -13,6 +13,13 @@ env:
1313
CARGO_TERM_COLOR: always
1414
RUST_BACKTRACE: full
1515

16+
# Every time a PR is pushed to, cancel any previous jobs. This
17+
# makes us behave nicer to github and get faster turnaround times
18+
# on PRs that are pushed to multiple times in rapid succession.
19+
concurrency:
20+
group: ${{github.workflow}}-${{github.ref}}
21+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
22+
1623
jobs:
1724
publish:
1825
runs-on: ubuntu-latest

.github/workflows/shaders.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ env:
1818
# We don't include the 4th version number, as it's not used in any URL.
1919
VULKAN_SDK_VERSION: "1.4.313"
2020

21+
# Every time a PR is pushed to, cancel any previous jobs. This
22+
# makes us behave nicer to github and get faster turnaround times
23+
# on PRs that are pushed to multiple times in rapid succession.
24+
concurrency:
25+
group: ${{github.workflow}}-${{github.ref}}
26+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
27+
2128
jobs:
2229
naga-validate-windows:
2330
name: "Validate: HLSL"

0 commit comments

Comments
 (0)