Skip to content

Commit 5a2909d

Browse files
ci: add workflow permissions (#99)
1 parent bb327e6 commit 5a2909d

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
branches:
77
- main
88

9+
permissions:
10+
contents: read
11+
912
env:
1013
RUSTFLAGS: '-Dwarnings'
1114

@@ -19,19 +22,16 @@ jobs:
1922
uses: actions/checkout@v5
2023

2124
- name: Set up Rust toolchain
22-
run: rustup toolchain install stable --no-self-update --profile default --target wasm32-unknown-unknown
23-
24-
- name: Set up Rust cache
25-
uses: swatinem/rust-cache@v2
25+
uses: actions-rust-lang/setup-rust-toolchain@v1
2626
with:
27-
cache-on-failure: true
28-
save-if: ${{ github.ref == 'refs/heads/main' }}
27+
components: clippy, rustfmt
28+
target: wasm32-unknown-unknown
2929

3030
- name: Check formatting
3131
run: cargo fmt --all --check
3232

3333
- name: Lint
34-
run: cargo clippy --all-features
34+
run: cargo clippy --all-features --locked
3535

3636
- name: Test
37-
run: cargo test --all-features
37+
run: cargo test --all-features --locked --release

.github/workflows/website.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
contents: read
10+
811
concurrency:
912
group: ${{ github.workflow }}-${{ github.ref }}
1013
cancel-in-progress: false
@@ -13,21 +16,17 @@ jobs:
1316
slides-build:
1417
name: Build Slides
1518
runs-on: ubuntu-latest
19+
1620
steps:
1721
- uses: actions/checkout@v5
1822
with:
1923
fetch-depth: 0
2024

2125
- name: Set up Rust toolchain
22-
run: |
23-
rustup toolchain install stable --no-self-update --profile minimal
24-
rustup target add wasm32-unknown-unknown
25-
26-
- name: Set up Rust cache
27-
uses: swatinem/rust-cache@v2
26+
uses: actions-rust-lang/setup-rust-toolchain@v1
2827
with:
29-
cache-on-failure: true
30-
save-if: ${{ github.ref == 'refs/heads/main' }}
28+
components: clippy, rustfmt
29+
target: wasm32-unknown-unknown
3130

3231
- name: Install Cargo Binary Install
3332
uses: cargo-bins/cargo-binstall@main
@@ -54,10 +53,12 @@ jobs:
5453
needs: slides-build
5554
if: github.ref == 'refs/heads/main'
5655
runs-on: ubuntu-latest
56+
5757
permissions:
5858
contents: read
5959
pages: write
6060
id-token: write
61+
6162
steps:
6263
- uses: actions/checkout@v5
6364
with:

0 commit comments

Comments
 (0)