Skip to content

Commit 3ec6512

Browse files
ci: use reusable workflows
1 parent e18cc69 commit 3ec6512

2 files changed

Lines changed: 11 additions & 121 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -10,57 +10,8 @@ permissions:
1010
contents: read
1111

1212
jobs:
13-
lint:
14-
name: Lint
15-
runs-on: ubuntu-latest
16-
17-
env:
18-
RUSTFLAGS: '-Dwarnings'
19-
20-
steps:
21-
- name: Checkout
22-
uses: actions/checkout@v6
23-
24-
- name: Set up Rust toolchain
25-
uses: actions-rust-lang/setup-rust-toolchain@v1
26-
with:
27-
components: clippy, rustfmt
28-
target: wasm32-unknown-unknown
29-
30-
- name: Install Cargo Binary Install
31-
uses: cargo-bins/cargo-binstall@main
32-
33-
- name: Install crates
34-
run: cargo binstall -y --force cargo-deny cargo-machete cargo-sort
35-
36-
- name: Lint
37-
run: cargo clippy --all-features --locked
38-
39-
- name: Check dependencies
40-
run: cargo deny check
41-
42-
- name: Check unused dependencies
43-
run: cargo machete
44-
45-
- name: Check manifest formatting
46-
run: cargo sort --workspace --check .
47-
48-
- name: Check formatting
49-
run: cargo fmt --all --check
50-
51-
test:
52-
name: Test
53-
runs-on: ubuntu-latest
54-
55-
steps:
56-
- name: Checkout
57-
uses: actions/checkout@v6
58-
59-
- name: Set up Rust toolchain
60-
uses: actions-rust-lang/setup-rust-toolchain@v1
61-
with:
62-
components: clippy, rustfmt
63-
target: wasm32-unknown-unknown
64-
65-
- name: Test
66-
run: cargo test --all-features --locked --release
13+
rust:
14+
name: Rust
15+
uses: RustForWeb/.github/.github/workflows/rust.yml@94e5af76a27a4691153fae17ed42eb08677f8d3f
16+
with:
17+
target: wasm32-unknown-unknown

.github/workflows/website.yml

Lines changed: 6 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Website
2+
23
on:
34
pull_request: {}
45
push:
@@ -7,76 +8,14 @@ on:
78

89
permissions:
910
contents: read
11+
id-token: write
12+
pages: write
1013

1114
concurrency:
1215
group: ${{ github.workflow }}-${{ github.ref }}
1316
cancel-in-progress: false
1417

1518
jobs:
16-
website-build:
17-
name: Build Website
18-
runs-on: ubuntu-latest
19-
20-
steps:
21-
- uses: actions/checkout@v6
22-
with:
23-
fetch-depth: 0
24-
25-
- name: Set up Rust toolchain
26-
uses: actions-rust-lang/setup-rust-toolchain@v1
27-
with:
28-
target: wasm32-unknown-unknown
29-
30-
- name: Install Cargo Binary Install
31-
uses: cargo-bins/cargo-binstall@main
32-
33-
- name: Install Trunk
34-
run: cargo binstall --force -y trunk
35-
36-
- name: Install Node.js dependencies
37-
run: npm ci
38-
39-
- name: Build Website
40-
run: trunk build
41-
42-
- name: Upload artifact
43-
uses: actions/upload-artifact@v7
44-
with:
45-
name: website
46-
path: dist
47-
retention-days: 1
48-
if-no-files-found: error
49-
50-
deploy:
51-
name: Deploy
52-
needs: website-build
53-
if: github.ref == 'refs/heads/main'
54-
runs-on: ubuntu-latest
55-
56-
permissions:
57-
contents: read
58-
pages: write
59-
id-token: write
60-
61-
steps:
62-
- uses: actions/checkout@v6
63-
with:
64-
fetch-depth: 0
65-
66-
- name: Download artifacts
67-
uses: actions/download-artifact@v8
68-
with:
69-
path: dist
70-
merge-multiple: true
71-
72-
- name: Setup Pages
73-
uses: actions/configure-pages@v6
74-
75-
- name: Upload artifact
76-
uses: actions/upload-pages-artifact@v5
77-
with:
78-
path: dist
79-
80-
- name: Deploy to GitHub Pages
81-
id: deployment
82-
uses: actions/deploy-pages@v5
19+
book:
20+
name: Trunk
21+
uses: RustForWeb/.github/.github/workflows/trunk.yml@94e5af76a27a4691153fae17ed42eb08677f8d3f

0 commit comments

Comments
 (0)