Skip to content

Commit a1d7f47

Browse files
committed
add rust-toolchain.toml
workflow: clean up configs
1 parent 7b2f576 commit a1d7f47

File tree

4 files changed

+90
-55
lines changed

4 files changed

+90
-55
lines changed

.github/workflows/solana.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: solana
2+
23
on:
34
push:
45
branches:
@@ -8,7 +9,9 @@ on:
89
- 'solana/**'
910

1011
env:
12+
CARGO_TERM_COLOR: always
1113
RUSTC_VERSION: 1.75.0
14+
1215
jobs:
1316
cancel-previous-runs:
1417
runs-on: ubuntu-latest
@@ -17,6 +20,7 @@ jobs:
1720
uses: styfle/cancel-workflow-action@0.9.1
1821
with:
1922
access_token: ${{ github.token }}
23+
2024
make-cargo-test-all:
2125
name: make cargo-test-all
2226
runs-on: ubuntu-latest
@@ -26,10 +30,10 @@ jobs:
2630
uses: dtolnay/rust-toolchain@master
2731
with:
2832
toolchain: ${{ env.RUSTC_VERSION }}
29-
components: clippy, rustfmt
3033
- name: make cargo-test-all
3134
run: make cargo-test-all
3235
working-directory: ./solana
36+
3337
make-lint:
3438
name: make lint
3539
runs-on: ubuntu-latest
@@ -43,6 +47,7 @@ jobs:
4347
- name: make lint
4448
run: make lint
4549
working-directory: ./solana
50+
4651
make-check-idl:
4752
name: make check-idl
4853
runs-on: ubuntu-latest
@@ -59,6 +64,7 @@ jobs:
5964
- name: make check-idl
6065
run: make check-idl
6166
working-directory: ./solana
67+
6268
make-anchor-test:
6369
name: make anchor-test
6470
runs-on: ubuntu-latest
@@ -79,6 +85,7 @@ jobs:
7985
- name: make anchor-test
8086
run: make anchor-test
8187
working-directory: ./solana
88+
8289
make-anchor-test-upgrade:
8390
name: make anchor-test-upgrade
8491
runs-on: ubuntu-latest

.github/workflows/universal-rs.yml

+66-54
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,76 @@
11
name: universal-rs
22

33
on:
4-
push:
5-
branches: [main]
6-
pull_request:
7-
paths:
8-
- 'universal/**'
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
paths:
9+
- 'universal/**'
910

1011
env:
11-
CARGO_TERM_COLOR: always
12+
CARGO_TERM_COLOR: always
13+
RUSTC_VERSION: 1.75.0
1214

1315
jobs:
14-
test:
15-
name: test ${{ matrix.rust }}
16-
runs-on: ubuntu-latest
17-
timeout-minutes: 30
18-
strategy:
19-
fail-fast: false
20-
matrix:
21-
rust: ["stable", "beta", "nightly", "1.75"] # MSRV
22-
steps:
23-
- uses: actions/checkout@v3
24-
- uses: dtolnay/rust-toolchain@master
25-
with:
26-
toolchain: ${{ matrix.rust }}
27-
- uses: Swatinem/rust-cache@v2
28-
- name: test
29-
run: cd universal/rs && cargo test --workspace --all-features
16+
test:
17+
name: test
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 30
20+
strategy:
21+
fail-fast: false
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Install toolchain
25+
uses: dtolnay/rust-toolchain@master
26+
with:
27+
toolchain: ${{ env.RUSTC_VERSION }}
28+
- name: test
29+
run: cargo test --workspace --all-features
30+
working-directory: ./universal/rs
3031

31-
clippy:
32-
name: clippy
33-
runs-on: ubuntu-latest
34-
timeout-minutes: 30
35-
steps:
36-
- uses: actions/checkout@v3
37-
- uses: dtolnay/rust-toolchain@clippy
38-
- run: cd universal/rs && cargo clippy --workspace --all-targets
39-
env:
40-
RUSTFLAGS: -Dwarnings
32+
clippy:
33+
name: clippy
34+
runs-on: ubuntu-latest
35+
timeout-minutes: 30
36+
steps:
37+
- uses: actions/checkout@v4
38+
- name: Install toolchain
39+
uses: dtolnay/rust-toolchain@master
40+
with:
41+
toolchain: ${{ env.RUSTC_VERSION }}
42+
components: clippy
43+
- run: cargo clippy --workspace --all-targets
44+
working-directory: ./universal/rs
45+
env:
46+
RUSTFLAGS: -Dwarnings
4147

42-
docs:
43-
name: docs
44-
runs-on: ubuntu-latest
45-
timeout-minutes: 30
46-
steps:
47-
- uses: actions/checkout@v3
48-
- uses: dtolnay/rust-toolchain@nightly
49-
with:
50-
components: rust-docs
51-
- run: cd universal/rs && cargo doc --workspace --no-deps --document-private-items
52-
env:
53-
RUSTDOCFLAGS: "--cfg docsrs -D warnings"
48+
docs:
49+
name: docs
50+
runs-on: ubuntu-latest
51+
timeout-minutes: 30
52+
steps:
53+
- uses: actions/checkout@v4
54+
- name: Install toolchain
55+
uses: dtolnay/rust-toolchain@master
56+
with:
57+
toolchain: ${{ env.RUSTC_VERSION }}
58+
components: rust-docs
59+
- run: cargo doc --workspace --no-deps --document-private-items
60+
working-directory: ./universal/rs
61+
env:
62+
RUSTDOCFLAGS: "--cfg docsrs -D warnings"
5463

55-
fmt:
56-
name: fmt
57-
runs-on: ubuntu-latest
58-
timeout-minutes: 30
59-
steps:
60-
- uses: actions/checkout@v3
61-
- uses: dtolnay/rust-toolchain@nightly
62-
with:
63-
components: rustfmt
64-
- run: cd universal/rs && cargo fmt --all --check
64+
fmt:
65+
name: fmt
66+
runs-on: ubuntu-latest
67+
timeout-minutes: 30
68+
steps:
69+
- uses: actions/checkout@v4
70+
- name: Install toolchain
71+
uses: dtolnay/rust-toolchain@master
72+
with:
73+
toolchain: ${{ env.RUSTC_VERSION }}
74+
components: rustfmt
75+
- run: cargo fmt --all --check
76+
working-directory: ./universal/rs

solana/rust-toolchain.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[toolchain]
2+
channel = "1.75"
3+
components = [
4+
"clippy",
5+
"rustfmt",
6+
"rustc-dev"
7+
]
8+
profile = "minimal"

universal/rs/rust-toolchain.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[toolchain]
2+
channel = "1.75"
3+
components = [
4+
"clippy",
5+
"rustfmt",
6+
"rustc-dev"
7+
]
8+
profile = "minimal"

0 commit comments

Comments
 (0)