2020 git rev-list --reverse ${{github.event.before}}..${{github.event.after}} | \
2121 awk '{ printf "{\"num\":" NR ",\"sha\":\"" $1 "\",\"short\":\"" substr($1, 0, 12) "\"}," }' | \
2222 sed 's/,$//' | \
23- awk '{ printf "commits=[" $1 "]" }' >> $GITHUB_OUTPUT
23+ awk '{ printf "[" $1 "]" }' | \
24+ jq -c . | \
25+ awk '{ print "commits=" $1 }' >> $GITHUB_OUTPUT
2426 cat $GITHUB_OUTPUT
2527 - name : Get commit list (PR)
2628 id : get_commit_list_pr
@@ -29,198 +31,195 @@ jobs:
2931 git rev-list --reverse ${{github.event.pull_request.base.sha}}..${{github.event.pull_request.head.sha}} | \
3032 awk '{ printf "{\"num\":" NR ",\"sha\":\"" $1 "\",\"short\":\"" substr($1, 0, 12) "\"}," }' | \
3133 sed 's/,$//' | \
32- awk '{ printf "commits=[" $1 "]" }' >> $GITHUB_OUTPUT
34+ awk '{ printf "[" $1 "]" }' | \
35+ jq -c . | \
36+ awk '{ print "commits=" $1 }' >> $GITHUB_OUTPUT
3337 cat $GITHUB_OUTPUT
3438 outputs :
3539 commits : ${{toJSON(steps.*.outputs.commits)}}
36- debug :
40+ fmt :
3741 needs : commit_list
42+ strategy :
43+ matrix :
44+ commit : ${{fromJSON(needs.commit_list.outputs.commits)}}
45+ name : " fmt #${{matrix.commit.num}} (${{matrix.commit.short}})"
3846 runs-on : ubuntu-latest
3947 steps :
40- - run : echo "${{needs.commit_list.outputs.commits}}"
41- # fmt:
42- # needs: commit_list
43- # strategy:
44- # matrix:
45- # commit: ${{fromJSON(needs.commit_list.outputs.commits)}}
46- # name: "fmt #${{matrix.commit.num}} (${{matrix.commit.short}})"
47- # runs-on: ubuntu-latest
48- # steps:
49- # - run: echo "${{fromJSON(needs.commit_list.outputs.commits)}}"
50- # - uses: actions/checkout@v4
51- # with:
52- # ref: ${{matrix.commit.sha}}
53- # - uses: dtolnay/rust-toolchain@nightly
54- # with:
55- # components: rustfmt
56- # - run: cargo fmt --check
57- # - run: cd internal && cargo fmt --check
58- # readme:
59- # needs: commit_list
60- # runs-on: ubuntu-latest
61- # strategy:
62- # matrix:
63- # commit: ${{fromJSON(needs.commit_list.outputs.commits)}}
64- # name: "readme #${{matrix.commit.num}} (${{matrix.commit.short}})"
65- # steps:
66- # - uses: actions/checkout@v4
67- # with:
68- # ref: ${{matrix.commit.sha}}
69- # - uses: dtolnay/rust-toolchain@nightly
70- # - run: cargo install cargo-rdme
71- # - run: cargo rdme --check
72- # docs:
73- # needs: commit_list
74- # runs-on: ubuntu-latest
75- # strategy:
76- # matrix:
77- # commit: ${{fromJSON(needs.commit_list.outputs.commits)}}
78- # name: "docs #${{matrix.commit.num}} (${{matrix.commit.short}})"
79- # steps:
80- # - uses: actions/checkout@v4
81- # with:
82- # ref: ${{matrix.commit.sha}}
83- # - uses: dtolnay/rust-toolchain@nightly
84- # - uses: dtolnay/rust-toolchain@nightly
85- # with:
86- # components: rust-src
87- # - run: cargo doc --no-deps
88- # clippy:
89- # needs: commit_list
90- # runs-on: ubuntu-latest
91- # strategy:
92- # matrix:
93- # commit: ${{fromJSON(needs.commit_list.outputs.commits)}}
94- # name: "clippy #${{matrix.commit.num}} (${{matrix.commit.short}})"
95- # steps:
96- # - uses: actions/checkout@v4
97- # with:
98- # ref: ${{matrix.commit.sha}}
99- # - uses: dtolnay/rust-toolchain@nightly
100- # with:
101- # components: clippy
102- # - run: cargo install cargo-hack
103- # - run: cargo hack --clean-per-run --feature-powerset clippy --locked
104- # test:
105- # needs: commit_list
106- # runs-on: ubuntu-latest
107- # strategy:
108- # matrix:
109- # commit: ${{fromJSON(needs.commit_list.outputs.commits)}}
110- # name: "test #${{matrix.commit.num}} (${{matrix.commit.short}})"
111- # steps:
112- # - uses: actions/checkout@v4
113- # - uses: dtolnay/rust-toolchain@nightly
114- # with:
115- # components: rust-src
116- # - run: cargo install cargo-expand
117- # - run: cargo test --locked
118- # miri:
119- # needs: commit_list
120- # runs-on: ubuntu-latest
121- # strategy:
122- # fail-fast: false
123- # matrix:
124- # commit: ${{fromJSON(needs.commit_list.outputs.commits)}}
125- # flags: [
126- # "",
127- # "-Zmiri-tree-borrows",
128- # "-Zmiri-strict-provenance",
129- # "-Zmiri-tree-borrows -Zmiri-strict-provenance",
130- # ]
131- # name: "miri #${{matrix.commit.num}} (${{matrix.commit.short}})"
132- # steps:
133- # - uses: actions/checkout@v4
134- # with:
135- # ref: ${{matrix.commit.sha}}
136- # - run: |
137- # echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> $GITHUB_ENV
138- # - name: Install ${{env.NIGHTLY}}
139- # uses: dtolnay/rust-toolchain@master
140- # with:
141- # toolchain: ${{env.NIGHTLY}}
142- # components: miri, rust-src
143- # - run: cargo install cargo-expand
144- # - name: ${{matrix.flags}} cargo miri test
145- # run: cargo miri test --locked
146- # env:
147- # MIRIFLAGS: ${{matrix.flags}}
148- # sanitizers:
149- # needs: commit_list
150- # runs-on: ubuntu-latest
151- # strategy:
152- # matrix:
153- # commit: ${{fromJSON(needs.commit_list.outputs.commits)}}
154- # name: "sanitizers #${{matrix.commit.num}} (${{matrix.commit.short}})"
155- # steps:
156- # - uses: actions/checkout@v4
157- # with:
158- # ref: ${{matrix.commit.sha}}
159- # - uses: dtolnay/rust-toolchain@nightly
160- # with:
161- # components: rust-src
162- # - name: enable debug symbols
163- # run: |
164- # sudo apt install llvm
165- # # https://github.com/japaric/rust-san#unrealiable-leaksanitizer
166- # sed -i '/\[features\]/i [profile.dev]' Cargo.toml
167- # sed -i '/profile.dev/a opt-level = 1' Cargo.toml
168- # cat Cargo.toml
169- # - run: cargo test --lib --tests --target x86_64-unknown-linux-gnu
170- # env:
171- # ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0"
172- # RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=address"
173- # - run: cargo test --target x86_64-unknown-linux-gnu
174- # env:
175- # RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=leak"
176- # msrv:
177- # needs: commit_list
178- # runs-on: ubuntu-latest
179- # strategy:
180- # matrix:
181- # commit: ${{fromJSON(needs.commit_list.outputs.commits)}}
182- # name: "msrv #${{matrix.commit.num}} (${{matrix.commit.short}})"
183- # steps:
184- # - uses: actions/checkout@v4
185- # with:
186- # ref: ${{matrix.commit.sha}}
187- # - uses: dtolnay/rust-toolchain@stable
188- # - run: cargo install cargo-hack
189- # - run: cargo hack --clean-per-run --feature-powerset --exclude-features alloc --exclude-features default --version-range 1.82.. --clean-per-version check --locked
190- # nightly-msrv:
191- # needs: commit_list
192- # runs-on: ubuntu-latest
193- # strategy:
194- # matrix:
195- # commit: ${{fromJSON(needs.commit_list.outputs.commits)}}
196- # name: "nightly-msrv #${{matrix.commit.num}} (${{matrix.commit.short}})"
197- # steps:
198- # - uses: actions/checkout@v4
199- # with:
200- # ref: ${{matrix.commit.sha}}
201- # - uses: dtolnay/rust-toolchain@stable
202- # with:
203- # components: rust-src
204- # - run: cargo install cargo-hack
205- # - run: cargo install cargo-expand
206- # - run: cargo hack --clean-per-run --feature-powerset --version-range 1.78.. --clean-per-version check --locked
207- # env:
208- # RUSTC_BOOTSTRAP: 1
209- # os-check:
210- # needs: commit_list
211- # strategy:
212- # fail-fast: false
213- # matrix:
214- # os: [macos-latest, windows-latest]
215- # commit: ${{fromJSON(needs.commit_list.outputs.commits)}}
216- # runs-on: ${{matrix.os}}
217- # name: "os-check (${{matrix.os}}) #${{matrix.commit.num}} (${{matrix.commit.short}})"
218- # steps:
219- # - uses: actions/checkout@v4
220- # with:
221- # ref: ${{matrix.commit.sha}}
222- # - uses: dtolnay/rust-toolchain@nightly
223- # with:
224- # components: rust-src
225- # - run: cargo install cargo-expand
226- # - run: cargo test --locked
48+ - run : echo "${{fromJSON(needs.commit_list.outputs.commits)}}"
49+ - uses : actions/checkout@v4
50+ with :
51+ ref : ${{matrix.commit.sha}}
52+ - uses : dtolnay/rust-toolchain@nightly
53+ with :
54+ components : rustfmt
55+ - run : cargo fmt --check
56+ - run : cd internal && cargo fmt --check
57+ readme :
58+ needs : commit_list
59+ runs-on : ubuntu-latest
60+ strategy :
61+ matrix :
62+ commit : ${{fromJSON(needs.commit_list.outputs.commits)}}
63+ name : " readme #${{matrix.commit.num}} (${{matrix.commit.short}})"
64+ steps :
65+ - uses : actions/checkout@v4
66+ with :
67+ ref : ${{matrix.commit.sha}}
68+ - uses : dtolnay/rust-toolchain@nightly
69+ - run : cargo install cargo-rdme
70+ - run : cargo rdme --check
71+ docs :
72+ needs : commit_list
73+ runs-on : ubuntu-latest
74+ strategy :
75+ matrix :
76+ commit : ${{fromJSON(needs.commit_list.outputs.commits)}}
77+ name : " docs #${{matrix.commit.num}} (${{matrix.commit.short}})"
78+ steps :
79+ - uses : actions/checkout@v4
80+ with :
81+ ref : ${{matrix.commit.sha}}
82+ - uses : dtolnay/rust-toolchain@nightly
83+ - uses : dtolnay/rust-toolchain@nightly
84+ with :
85+ components : rust-src
86+ - run : cargo doc --no-deps
87+ clippy :
88+ needs : commit_list
89+ runs-on : ubuntu-latest
90+ strategy :
91+ matrix :
92+ commit : ${{fromJSON(needs.commit_list.outputs.commits)}}
93+ name : " clippy #${{matrix.commit.num}} (${{matrix.commit.short}})"
94+ steps :
95+ - uses : actions/checkout@v4
96+ with :
97+ ref : ${{matrix.commit.sha}}
98+ - uses : dtolnay/rust-toolchain@nightly
99+ with :
100+ components : clippy
101+ - run : cargo install cargo-hack
102+ - run : cargo hack --clean-per-run --feature-powerset clippy --locked
103+ test :
104+ needs : commit_list
105+ runs-on : ubuntu-latest
106+ strategy :
107+ matrix :
108+ commit : ${{fromJSON(needs.commit_list.outputs.commits)}}
109+ name : " test #${{matrix.commit.num}} (${{matrix.commit.short}})"
110+ steps :
111+ - uses : actions/checkout@v4
112+ - uses : dtolnay/rust-toolchain@nightly
113+ with :
114+ components : rust-src
115+ - run : cargo install cargo-expand
116+ - run : cargo test --locked
117+ miri :
118+ needs : commit_list
119+ runs-on : ubuntu-latest
120+ strategy :
121+ fail-fast : false
122+ matrix :
123+ commit : ${{fromJSON(needs.commit_list.outputs.commits)}}
124+ flags : [
125+ " " ,
126+ " -Zmiri-tree-borrows" ,
127+ " -Zmiri-strict-provenance" ,
128+ " -Zmiri-tree-borrows -Zmiri-strict-provenance" ,
129+ ]
130+ name : " miri #${{matrix.commit.num}} (${{matrix.commit.short}})"
131+ steps :
132+ - uses : actions/checkout@v4
133+ with :
134+ ref : ${{matrix.commit.sha}}
135+ - run : |
136+ echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> $GITHUB_ENV
137+ - name : Install ${{env.NIGHTLY}}
138+ uses : dtolnay/rust-toolchain@master
139+ with :
140+ toolchain : ${{env.NIGHTLY}}
141+ components : miri, rust-src
142+ - run : cargo install cargo-expand
143+ - name : ${{matrix.flags}} cargo miri test
144+ run : cargo miri test --locked
145+ env :
146+ MIRIFLAGS : ${{matrix.flags}}
147+ sanitizers :
148+ needs : commit_list
149+ runs-on : ubuntu-latest
150+ strategy :
151+ matrix :
152+ commit : ${{fromJSON(needs.commit_list.outputs.commits)}}
153+ name : " sanitizers #${{matrix.commit.num}} (${{matrix.commit.short}})"
154+ steps :
155+ - uses : actions/checkout@v4
156+ with :
157+ ref : ${{matrix.commit.sha}}
158+ - uses : dtolnay/rust-toolchain@nightly
159+ with :
160+ components : rust-src
161+ - name : enable debug symbols
162+ run : |
163+ sudo apt install llvm
164+ # https://github.com/japaric/rust-san#unrealiable-leaksanitizer
165+ sed -i '/\[features\]/i [profile.dev]' Cargo.toml
166+ sed -i '/profile.dev/a opt-level = 1' Cargo.toml
167+ cat Cargo.toml
168+ - run : cargo test --lib --tests --target x86_64-unknown-linux-gnu
169+ env :
170+ ASAN_OPTIONS : " detect_odr_violation=0:detect_leaks=0"
171+ RUSTFLAGS : " --cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=address"
172+ - run : cargo test --target x86_64-unknown-linux-gnu
173+ env :
174+ RUSTFLAGS : " --cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=leak"
175+ msrv :
176+ needs : commit_list
177+ runs-on : ubuntu-latest
178+ strategy :
179+ matrix :
180+ commit : ${{fromJSON(needs.commit_list.outputs.commits)}}
181+ name : " msrv #${{matrix.commit.num}} (${{matrix.commit.short}})"
182+ steps :
183+ - uses : actions/checkout@v4
184+ with :
185+ ref : ${{matrix.commit.sha}}
186+ - uses : dtolnay/rust-toolchain@stable
187+ - run : cargo install cargo-hack
188+ - run : cargo hack --clean-per-run --feature-powerset --exclude-features alloc --exclude-features default --version-range 1.82.. --clean-per-version check --locked
189+ nightly-msrv :
190+ needs : commit_list
191+ runs-on : ubuntu-latest
192+ strategy :
193+ matrix :
194+ commit : ${{fromJSON(needs.commit_list.outputs.commits)}}
195+ name : " nightly-msrv #${{matrix.commit.num}} (${{matrix.commit.short}})"
196+ steps :
197+ - uses : actions/checkout@v4
198+ with :
199+ ref : ${{matrix.commit.sha}}
200+ - uses : dtolnay/rust-toolchain@stable
201+ with :
202+ components : rust-src
203+ - run : cargo install cargo-hack
204+ - run : cargo install cargo-expand
205+ - run : cargo hack --clean-per-run --feature-powerset --version-range 1.78.. --clean-per-version check --locked
206+ env :
207+ RUSTC_BOOTSTRAP : 1
208+ os-check :
209+ needs : commit_list
210+ strategy :
211+ fail-fast : false
212+ matrix :
213+ os : [macos-latest, windows-latest]
214+ commit : ${{fromJSON(needs.commit_list.outputs.commits)}}
215+ runs-on : ${{matrix.os}}
216+ name : " os-check (${{matrix.os}}) #${{matrix.commit.num}} (${{matrix.commit.short}})"
217+ steps :
218+ - uses : actions/checkout@v4
219+ with :
220+ ref : ${{matrix.commit.sha}}
221+ - uses : dtolnay/rust-toolchain@nightly
222+ with :
223+ components : rust-src
224+ - run : cargo install cargo-expand
225+ - run : cargo test --locked
0 commit comments