Skip to content

Commit a0e40e0

Browse files
ci: update workflows (#92)
1 parent ef6ac7d commit a0e40e0

4 files changed

Lines changed: 54 additions & 145 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@373c25f8fd29e10c40f1343f13312f8be3514af0
16+
with:
17+
target: wasm32-unknown-unknown

.github/workflows/publish.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
id-token: write
10+
11+
jobs:
12+
publish:
13+
name: Publish
14+
uses: RustForWeb/.github/.github/workflows/publish.yml@373c25f8fd29e10c40f1343f13312f8be3514af0
15+
with:
16+
target: wasm32-unknown-unknown

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
bump:
7+
description: 'Bump version by semver keyword.'
8+
required: true
9+
type: choice
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
15+
permissions:
16+
contents: write
17+
18+
jobs:
19+
release:
20+
name: Release
21+
uses: RustForWeb/.github/.github/workflows/release.yml@373c25f8fd29e10c40f1343f13312f8be3514af0
22+
with:
23+
bump: ${{ inputs.bump }}
24+
target: wasm32-unknown-unknown

.github/workflows/website.yml

Lines changed: 9 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,21 @@
11
name: Website
2+
23
on:
34
pull_request: {}
45
push:
56
branches:
67
- main
78

9+
permissions:
10+
contents: read
11+
id-token: write
12+
pages: write
13+
814
concurrency:
915
group: ${{ github.workflow }}-${{ github.ref }}
1016
cancel-in-progress: false
1117

1218
jobs:
13-
book-test:
14-
name: Test Book
15-
runs-on: ubuntu-latest
16-
steps:
17-
- uses: actions/checkout@v6
18-
19-
- name: Set up Rust toolchain
20-
uses: actions-rust-lang/setup-rust-toolchain@v1
21-
with:
22-
target: wasm32-unknown-unknown
23-
24-
- name: Install Cargo Binary Install
25-
uses: cargo-bins/cargo-binstall@main
26-
27-
- name: Install mdBook
28-
run: cargo binstall --force -y mdbook mdbook-tabs mdbook-trunk
29-
30-
- name: Run tests
31-
run: mdbook test
32-
working-directory: book
33-
34-
book-build:
35-
name: Build Book
36-
needs: book-test
37-
runs-on: ubuntu-latest
38-
steps:
39-
- uses: actions/checkout@v6
40-
with:
41-
fetch-depth: 0
42-
43-
- name: Set up Rust toolchain
44-
uses: actions-rust-lang/setup-rust-toolchain@v1
45-
with:
46-
target: wasm32-unknown-unknown
47-
48-
- name: Install Cargo Binary Install
49-
uses: cargo-bins/cargo-binstall@main
50-
51-
- name: Install mdBook and Trunk
52-
run: cargo binstall --force -y mdbook mdbook-tabs mdbook-trunk trunk
53-
54-
- name: Install Node.js dependencies
55-
run: npm ci
56-
57-
- name: Build Book
58-
run: mdbook build
59-
working-directory: book
60-
61-
- name: Combine Book Outputs
62-
run: mdbook-trunk combine
63-
working-directory: book
64-
65-
- name: Upload artifact
66-
uses: actions/upload-artifact@v7
67-
with:
68-
name: book
69-
path: book/dist
70-
retention-days: 1
71-
if-no-files-found: error
72-
73-
deploy:
74-
name: Deploy
75-
needs: book-build
76-
if: github.ref == 'refs/heads/main'
77-
runs-on: ubuntu-latest
78-
permissions:
79-
contents: read
80-
pages: write
81-
id-token: write
82-
steps:
83-
- uses: actions/checkout@v6
84-
with:
85-
fetch-depth: 0
86-
87-
- name: Download artifacts
88-
uses: actions/download-artifact@v8
89-
with:
90-
path: dist
91-
merge-multiple: true
92-
93-
- name: Setup Pages
94-
uses: actions/configure-pages@v6
95-
96-
- name: Upload artifact
97-
uses: actions/upload-pages-artifact@v5
98-
with:
99-
path: dist
100-
101-
- name: Deploy to GitHub Pages
102-
id: deployment
103-
uses: actions/deploy-pages@v5
19+
book:
20+
name: Book
21+
uses: RustForWeb/.github/.github/workflows/book.yml@373c25f8fd29e10c40f1343f13312f8be3514af0

0 commit comments

Comments
 (0)