Skip to content

Commit 55a62fe

Browse files
authored
Update CI actions (#285)
* Upgrade actions/checkout: v2 -> v3 * Upgrade actions/cache: v2 -> v3 * Update `Create or update comment` step to use `body-file` * Switch to dtolnay/rust-toolchain * Use stable for benchmarking
1 parent 50d2c20 commit 55a62fe

File tree

3 files changed

+21
-62
lines changed

3 files changed

+21
-62
lines changed

.github/workflows/benchmark.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,13 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Git Checkout
27-
uses: actions/checkout@v2
27+
uses: actions/checkout@v3
2828
with:
2929
submodules: recursive
3030
- name: Rust Toolchain
31-
uses: actions-rs/toolchain@v1
31+
uses: dtolnay/rust-toolchain@master
3232
with:
33-
profile: minimal
34-
# nightly can be very volatile--pin this to a version we know works well...
35-
toolchain: nightly-2022-08-11
36-
override: true
33+
toolchain: stable
3734
# Run benchmark with `cargo bench` and stores the output to a file
3835
- name: Run benchmark
3936
run: cargo bench -- --output-format bencher | tee output.txt

.github/workflows/ci_build_test.yml

Lines changed: 15 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -23,41 +23,21 @@ jobs:
2323
if: runner.os == 'Windows'
2424
run: choco install llvm -y
2525
- name: Git Checkout
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v3
2727
with:
2828
submodules: recursive
2929
- name: Rust Toolchain
30-
uses: actions-rs/toolchain@v1
30+
uses: dtolnay/rust-toolchain@master
3131
with:
32-
profile: minimal
3332
toolchain: stable
34-
override: true
33+
components: clippy, rustfmt
3534
- name: Cargo Build
36-
uses: actions-rs/cargo@v1
37-
with:
38-
command: build
39-
args: --verbose --workspace
35+
run: cargo build --verbose --workspace
4036
- name: Cargo Test excluding conformance tests
41-
uses: actions-rs/cargo@v1
42-
with:
43-
command: test
44-
args: --verbose --workspace
37+
run: cargo test --verbose --workspace
4538
- name: Rustfmt Check
46-
uses: actions-rs/cargo@v1
47-
with:
48-
command: fmt
49-
args: --verbose --all -- --check
50-
# `clippy-check` will run `cargo clippy` on new pull requests. Due to a limitation in GitHub
51-
# permissions, the behavior of the Action is different depending on the source of the PR. If the
52-
# PR comes from the partiql-lang-rust project itself, any suggestions will be added to the PR as comments.
53-
# If the PR comes from a fork, any suggestions will be added to the Action's STDOUT for review.
54-
# For details, see: https://github.com/actions-rs/clippy-check/issues/2
55-
- name: Install Clippy
56-
# The clippy check depends on setup steps defined above, but we don't want it to run
57-
# for every OS because it posts its comments to the PR. These `if` checks limit clippy to
58-
# only running on the Linux test. (The choice of OS was arbitrary.)
5939
if: matrix.os == 'ubuntu-20.04'
60-
run: rustup component add clippy
40+
run: cargo fmt --verbose --all -- --check
6141
- name: Run Clippy
6242
if: matrix.os == 'ubuntu-20.04'
6343
uses: actions-rs/clippy-check@v1
@@ -68,7 +48,7 @@ jobs:
6848
# Cache the `cargo build` so future jobs can reuse build
6949
- name: Cache cargo build
7050
if: matrix.os == 'ubuntu-20.04'
71-
uses: actions/cache@v2
51+
uses: actions/cache@v3
7252
id: restore-build
7353
with:
7454
path: ./*
@@ -105,16 +85,14 @@ jobs:
10585
steps:
10686
# Pull down the cached `partiql-lang-rust` build from the `Build and Test` job. This allows us to reuse without
10787
# needing to rebuild. If pulling the build fails, the subsequent `cargo test` will rebuild.
108-
- uses: actions/checkout@v2
88+
- uses: actions/checkout@v3
10989
with:
11090
submodules: recursive
11191
- name: Rust Toolchain
112-
uses: actions-rs/toolchain@v1
92+
uses: dtolnay/rust-toolchain@master
11393
with:
114-
profile: minimal
11594
toolchain: stable
116-
override: true
117-
- uses: actions/cache@v2
95+
- uses: actions/cache@v3
11896
id: restore-build
11997
with:
12098
path: ./*
@@ -135,7 +113,7 @@ jobs:
135113
# Cache the `cargo build` and conformance report for `conformance-report-comparison` job (pull_request event only)
136114
- name: Cache `cargo build` and conformance report
137115
if: github.event_name == 'pull_request'
138-
uses: actions/cache@v2
116+
uses: actions/cache@v3
139117
id: restore-build-and-conformance
140118
with:
141119
path: ./*
@@ -147,16 +125,14 @@ jobs:
147125
if: github.event_name == 'pull_request'
148126
steps:
149127
# Pull down cached `cargo build` and conformance report
150-
- uses: actions/checkout@v2
128+
- uses: actions/checkout@v3
151129
with:
152130
submodules: recursive
153131
- name: Rust Toolchain
154-
uses: actions-rs/toolchain@v1
132+
uses: dtolnay/rust-toolchain@master
155133
with:
156-
profile: minimal
157134
toolchain: stable
158-
override: true
159-
- uses: actions/cache@v2
135+
- uses: actions/cache@v3
160136
id: restore-build-and-conformance
161137
with:
162138
path: ./*
@@ -191,21 +167,12 @@ jobs:
191167
issue-number: ${{ github.event.pull_request.number }}
192168
comment-author: 'github-actions[bot]'
193169
body-includes: Conformance
194-
# Convert the markdown comparison report to a readable form for GitHub PR comments
195-
- id: get-comment-body
196-
continue-on-error: true
197-
run: |
198-
body="$(cat ./cts-comparison-report.md)"
199-
body="${body//'%'/'%25'}"
200-
body="${body//$'\n'/'%0A'}"
201-
body="${body//$'\r'/'%0D'}"
202-
echo "::set-output name=body::$body"
203170
# Create or update (if previous comment exists) with markdown version of comparison report
204171
- name: Create or update comment
205172
continue-on-error: true
206173
uses: peter-evans/create-or-update-comment@v2
207174
with:
208175
comment-id: ${{ steps.fc.outputs.comment-id }}
209176
issue-number: ${{ github.event.pull_request.number }}
210-
body: ${{ steps.get-comment-body.outputs.body }}
177+
body-file: cts-comparison-report.md
211178
edit-mode: replace

.github/workflows/coverage.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,20 @@ jobs:
1919

2020
steps:
2121
- name: Git Checkout
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
2323
with:
2424
submodules: recursive
2525
- name: Rust Toolchain
26-
uses: actions-rs/toolchain@v1
26+
uses: dtolnay/rust-toolchain@master
2727
with:
28-
profile: minimal
2928
# nightly can be very volatile--pin this to a version we know works well...
3029
toolchain: nightly-2022-08-11
31-
override: true
3230
# Conformance tests are run with 'conformance_test' feature. Since step runs with 'all-features', the conformance
3331
# test are also run, which can cause `cargo test` to fail. Add 'continue-on-error' step to prevent GH Actions
3432
# failure.
3533
- name: Cargo Test
36-
uses: actions-rs/cargo@v1
3734
continue-on-error: true
38-
with:
39-
command: test
40-
args: --verbose --workspace --all-features --no-fail-fast -- -Z unstable-options --ensure-time
35+
run: cargo test --verbose --workspace --all-features --no-fail-fast -- -Z unstable-options --ensure-time
4136
env:
4237
CARGO_INCREMENTAL: '0'
4338
# https://github.com/marketplace/actions/rust-grcov

0 commit comments

Comments
 (0)