Skip to content

Commit d59fa3b

Browse files
authored
ci: split into multiple files (#12)
* ci: split into multiple files * chore: update README.md * ci: run docs on all branches and only deploy on main
1 parent 1ea2440 commit d59fa3b

File tree

4 files changed

+93
-59
lines changed

4 files changed

+93
-59
lines changed

.github/workflows/check.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Check
2+
3+
on: [push, pull_request]
4+
5+
env:
6+
RUST_BACKTRACE: 1
7+
8+
jobs:
9+
rustfmt:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v6
13+
14+
- uses: dtolnay/rust-toolchain@nightly
15+
with:
16+
components: rustfmt
17+
18+
- name: Check format
19+
run: cargo fmt --all --check
20+
21+
check:
22+
runs-on: ubuntu-latest
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
rust-toolchain:
27+
- nightly
28+
- nightly-2025-05-20
29+
- nightly-2025-12-12
30+
- stable
31+
env:
32+
RUSTC_BOOTSTRAP: "${{ matrix.rust-toolchain == 'stable' && '1' || '' }}"
33+
steps:
34+
- uses: actions/checkout@v6
35+
- uses: dtolnay/rust-toolchain@master
36+
with:
37+
toolchain: ${{ matrix.rust-toolchain }}
38+
components: clippy
39+
40+
- uses: taiki-e/install-action@cargo-hack
41+
- name: Clippy
42+
run: cargo hack clippy --feature-powerset -- -D warnings
43+
- name: Test
44+
run: cargo hack test --feature-powerset -- --nocapture

.github/workflows/ci.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

.github/workflows/docs.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Docs
2+
3+
on: [push, pull_request]
4+
5+
concurrency:
6+
group: pages
7+
cancel-in-progress: false
8+
9+
env:
10+
RUST_BACKTRACE: 1
11+
RUSTDOCFLAGS: -D rustdoc::broken_intra_doc_links -D missing-docs
12+
13+
defaults:
14+
run:
15+
shell: bash
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v6
22+
- uses: dtolnay/rust-toolchain@nightly
23+
24+
- name: Build docs
25+
run: cargo doc --all-features --no-deps
26+
27+
- name: Add redirect
28+
run: printf '<meta http-equiv="refresh" content="0;url=%s/index.html">' $(cargo tree | head -1 | cut -d' ' -f1) > target/doc/index.html
29+
30+
- uses: actions/configure-pages@v5
31+
- uses: actions/upload-pages-artifact@v4
32+
with:
33+
path: target/doc
34+
35+
deploy:
36+
runs-on: ubuntu-latest
37+
needs: build
38+
if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
39+
permissions:
40+
contents: read
41+
pages: write
42+
id-token: write
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
steps:
47+
- id: deployment
48+
uses: actions/deploy-pages@v4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Crates.io](https://img.shields.io/crates/v/axio)](https://crates.io/crates/axio)
44
[![Docs.rs](https://docs.rs/axio/badge.svg)](https://docs.rs/axio)
5-
[![CI](https://github.com/arceos-org/axio/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/arceos-org/axio/actions/workflows/ci.yml)
5+
[![CI](https://github.com/arceos-org/axio/actions/workflows/check.yml/badge.svg?branch=main)](https://github.com/arceos-org/axio/actions/workflows/check.yml)
66

77
[`std::io`][1]-like I/O traits for `no_std` environment.
88

0 commit comments

Comments
 (0)