Skip to content

Commit 5ae86e8

Browse files
authored
Merge pull request #1274 from Lorak-mmk/ci-cache
Use cache in CI
2 parents 5026755 + 775cdca commit 5ae86e8

8 files changed

+68
-56
lines changed

.github/workflows/authenticate_test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
- name: Checkout
2323
uses: actions/checkout@v3
2424

25-
- name: Update rust toolchain
26-
run: rustup update
25+
- name: Setup rust toolchain
26+
uses: actions-rust-lang/setup-rust-toolchain@v1
2727

2828
- name: Start the cluster
2929
run: docker compose -f test/cluster/docker-compose-passauth.yml up -d

.github/workflows/book.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ jobs:
2626
options: --health-cmd "cqlsh --debug scylladb" --health-interval 5s --health-retries 10
2727
steps:
2828
- uses: actions/checkout@v3
29-
# Set to 1.81 because of regression in 1.82: https://github.com/rust-lang/rust/issues/131893
30-
# TODO: change back to latest stable after this bug is fixed.
31-
- name: Update rust toolchain
32-
run: rustup default 1.81
29+
- name: Setup rust toolchain
30+
uses: actions-rust-lang/setup-rust-toolchain@v1
31+
with:
32+
# We can't use cache here, or mdbook will complain about multiple candidates for dependency.
33+
cache: false
3334
- name: Install mdbook
34-
run: cargo install mdbook --no-default-features
35+
uses: taiki-e/install-action@v2
36+
with:
37+
tool: mdbook
3538
- name: Build the project
3639
run: cargo build --examples
3740
- name: Build the book

.github/workflows/cassandra.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
run: |
2525
docker compose -f test/cluster/cassandra/docker-compose.yml up -d --wait
2626
# A separate step for building to separate measuring time of compilation and testing
27-
- name: Update rust toolchain
28-
run: rustup update
27+
- name: Setup rust toolchain
28+
uses: actions-rust-lang/setup-rust-toolchain@v1
2929
- name: Run tests on cassandra
3030
run: |
3131
CDC='disabled' RUSTFLAGS="--cfg cassandra_tests" RUST_LOG=trace SCYLLA_URI=172.42.0.2:9042 SCYLLA_URI2=172.42.0.3:9042 SCYLLA_URI3=172.42.0.4:9042 cargo test --features "full-serialization" -- --skip test_views_in_schema_info --skip test_large_batch_statements

.github/workflows/rust.yml

+36-29
Original file line numberDiff line numberDiff line change
@@ -21,61 +21,69 @@ jobs:
2121
timeout-minutes: 60
2222
steps:
2323
- uses: actions/checkout@v3
24-
- name: Update rust toolchain
25-
run: rustup update
24+
- name: Setup rust toolchain
25+
uses: actions-rust-lang/setup-rust-toolchain@v1
26+
with:
27+
components: clippy, rustfmt
2628
- name: Print rustc version
2729
run: rustc --version
2830
- name: Print rustfmt version
2931
run: cargo fmt --version
3032
- name: Print clippy version
3133
run: cargo clippy --version
34+
35+
# Formatting
3236
- name: Format check
3337
run: cargo fmt --all -- --check
38+
39+
# Basic clippy checks
3440
- name: Clippy check
3541
run: cargo clippy --all-targets
3642
- name: Clippy check with all features
3743
run: cargo clippy --all-targets --all-features
44+
45+
# Verify scylla-cql separately
46+
- name: Clippy scylla-cql
47+
run: cargo clippy --all-targets -p scylla-cql --features "full-serialization"
48+
49+
# cpp-rust-driver special cfg
3850
- name: Cargo check with cpp_rust_unstable cfg
39-
run: RUSTFLAGS="--cfg cpp_rust_unstable" cargo clippy --all-targets --all-features
51+
run: RUSTFLAGS="--cfg cpp_rust_unstable -Dwarnings" cargo clippy --all-targets --all-features
4052

4153
# Features checks.
4254
# No features.
4355
- name: Cargo check without features
44-
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features ""
56+
run: cargo check --all-targets -p scylla --features ""
4557

4658
# All features.
4759
- name: Cargo check with all features
48-
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --all-features
60+
run: cargo check --all-targets -p scylla --all-features
4961

5062
# Various (de)serialization features.
5163
- name: Cargo check with all serialization features
52-
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "full-serialization"
64+
run: cargo check --all-targets -p scylla --features "full-serialization"
5365
- name: Cargo check with metrics feature
54-
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "metrics"
66+
run: cargo check --all-targets -p scylla --features "metrics"
5567
- name: Cargo check with secrecy-08 feature
56-
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "secrecy-08"
68+
run: cargo check --all-targets -p scylla --features "secrecy-08"
5769
- name: Cargo check with chrono-04 feature
58-
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "chrono-04"
70+
run: cargo check --all-targets -p scylla --features "chrono-04"
5971
- name: Cargo check with time-03 feature
60-
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "time-03"
72+
run: cargo check --all-targets -p scylla --features "time-03"
6173
- name: Cargo check with num-bigint-03 feature
62-
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "num-bigint-03"
74+
run: cargo check --all-targets -p scylla --features "num-bigint-03"
6375
- name: Cargo check with num-bigint-04 feature
64-
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "num-bigint-04"
76+
run: cargo check --all-targets -p scylla --features "num-bigint-04"
6577
- name: Cargo check with bigdecimal-04 feature
66-
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "bigdecimal-04"
78+
run: cargo check --all-targets -p scylla --features "bigdecimal-04"
6779

6880
# TLS-related feature sets.
6981
- name: Cargo check with openssl-x feature
70-
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "openssl-010"
82+
run: cargo check --all-targets -p scylla --features "openssl-010"
7183
- name: Cargo check with rustls-x feature
72-
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "rustls-023"
84+
run: cargo check --all-targets -p scylla --features "rustls-023"
7385
# (openssl-x, rustls-x) is checked in tls.yml.
7486

75-
- name: Build scylla-cql
76-
run: cargo build --all-targets --manifest-path "scylla-cql/Cargo.toml" --features "full-serialization"
77-
- name: Build
78-
run: cargo build --all-targets --features "full-serialization"
7987
tests:
8088
runs-on: ubuntu-latest
8189
timeout-minutes: 60
@@ -85,13 +93,12 @@ jobs:
8593
run: |
8694
sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr"
8795
docker compose -f test/cluster/docker-compose.yml up -d --wait
88-
- name: Update rust toolchain
89-
run: rustup update
96+
- name: Setup rust toolchain
97+
uses: actions-rust-lang/setup-rust-toolchain@v1
9098
- name: Print rustc version
9199
run: rustc --version
92100
- name: Run tests
93101
run: |
94-
cargo clean
95102
RUST_LOG=trace SCYLLA_URI=172.42.0.2:9042 SCYLLA_URI2=172.42.0.3:9042 SCYLLA_URI3=172.42.0.4:9042 cargo test --features "full-serialization"
96103
- name: Stop the cluster
97104
if: ${{ always() }}
@@ -108,26 +115,26 @@ jobs:
108115
steps:
109116
- uses: actions/checkout@v3
110117
- name: Install Rust ${{ env.rust_min }}
111-
run: |
112-
rustup install ${{ env.rust_min }}
113-
rustup override set ${{ env.rust_min }}
118+
uses: actions-rust-lang/setup-rust-toolchain@v1
119+
with:
120+
toolchain: ${{ env.rust_min }}
114121
- name: Print Rust version
115122
run: rustc --version
116123
- name: Use MSRV Cargo.lock
117124
run: mv Cargo.lock.msrv Cargo.lock
118125
- name: MSRV cargo check with features
119126
run: cargo check --all-targets --all-features --locked
120127
- name: MSRV cargo check without features
121-
run: cargo check --all-targets --locked --manifest-path "scylla/Cargo.toml"
128+
run: cargo check --all-targets --locked -p scylla
122129
- name: MSRV cargo check scylla-cql
123-
run: cargo check --all-targets --locked --manifest-path "scylla-cql/Cargo.toml"
130+
run: cargo check --all-targets --locked -p scylla-cql
124131

125132
# Tests that docstrings generate docs without warnings
126133
cargo_docs:
127134
runs-on: ubuntu-latest
128135
steps:
129136
- uses: actions/checkout@v3
130-
- name: Update rust toolchain
131-
run: rustup update
137+
- name: Setup rust toolchain
138+
uses: actions-rust-lang/setup-rust-toolchain@v1
132139
- name: Compile docs
133140
run: RUSTDOCFLAGS=-Dwarnings cargo doc

.github/workflows/semver_checks.yml

+10-8
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ jobs:
5555
# I don't know any way to do this using checkout action
5656
- name: Fetch PR base
5757
run: git fetch origin "$PR_BASE"
58-
- name: Update rust toolchain
59-
run: rustup update
58+
- name: Setup rust toolchain
59+
uses: actions-rust-lang/setup-rust-toolchain@v1
6060
- name: Install semver-checks
61-
# Official action uses binary releases fetched from GitHub
62-
# If this pipeline becomes too slow, we should do this too.
63-
run: cargo install cargo-semver-checks --no-default-features --features gix-reqwest
61+
uses: taiki-e/install-action@v2
62+
with:
63+
tool: cargo-semver-checks
6464
- name: Verify the API compatibilty with PR base
6565
id: semver-pr-check
6666
run: |
@@ -143,9 +143,11 @@ jobs:
143143
timeout-minutes: 30
144144
steps:
145145
- uses: actions/checkout@v3
146-
- name: Update rust toolchain
147-
run: rustup update
146+
- name: Setup rust toolchain
147+
uses: actions-rust-lang/setup-rust-toolchain@v1
148148
- name: Install semver-checks
149-
run: cargo install cargo-semver-checks --no-default-features --features gix-reqwest
149+
uses: taiki-e/install-action@v2
150+
with:
151+
tool: cargo-semver-checks
150152
- name: Run semver-checks to see if it agrees with version updates
151153
run: make semver-version

.github/workflows/serverless.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ jobs:
2626
run: |
2727
ccm create serverless -i 127.0.1. -n 1 --scylla -v release:6.2
2828
ccm start --sni-proxy --sni-port 7777
29-
- name: Update rust toolchain
30-
run: rustup update
29+
- name: Setup rust toolchain
30+
uses: actions-rust-lang/setup-rust-toolchain@v1
3131
- name: Check
3232
run: cargo check
3333
# Cloud-related feature sets.
3434
- name: Cargo check with unstable-cloud and openssl-x features
35-
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "unstable-cloud" --features "openssl-010"
35+
run: cargo check --all-targets -p scylla --features "unstable-cloud" --features "openssl-010"
3636
- name: Cargo check with unstable-cloud and rustls-x features
37-
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "unstable-cloud" --features "rustls-023"
37+
run: cargo check --all-targets -p scylla --features "unstable-cloud" --features "rustls-023"
3838
- name: Cargo check with unstable-cloud, openssl-x and rustls-x features
39-
run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "unstable-cloud" --features "openssl-010" --features "rustls-023"
39+
run: cargo check --all-targets -p scylla --features "unstable-cloud" --features "openssl-010" --features "rustls-023"
4040

4141
- name: Run cloud-openssl example
4242
run: cargo run --example cloud-openssl -- $HOME/.ccm/serverless/config_data.yaml

.github/workflows/tls.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v3
2424

25-
- name: Update rust toolchain
26-
run: rustup update
25+
- name: Setup rust toolchain
26+
uses: actions-rust-lang/setup-rust-toolchain@v1
2727

2828
- name: Check
2929
run: cargo check --features "openssl-010" --features "rustls-023"

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ all: test
77
static: fmt-check check check-without-features check-all-features clippy clippy-all-features
88

99
.PHONY: ci
10-
ci: static test build
10+
ci: static test
1111

1212
.PHONY: dockerized-ci
13-
dockerized-ci: static dockerized-test build
13+
dockerized-ci: static dockerized-test
1414

1515
.PHONY: fmt
1616
fmt:
@@ -26,7 +26,7 @@ check:
2626

2727
.PHONY: check-without-features
2828
check-without-features:
29-
cargo check --manifest-path "scylla/Cargo.toml" --features "" --all-targets
29+
cargo check -p scylla --features "" --all-targets
3030

3131
.PHONY: check-all-features
3232
check-all-features:

0 commit comments

Comments
 (0)