-
Notifications
You must be signed in to change notification settings - Fork 713
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set-up a doc job in CI running on main
It upload the output of `cargo doc` on GitHub Pages
- Loading branch information
1 parent
4863d8b
commit afa6997
Showing
2 changed files
with
104 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,71 +15,71 @@ jobs: | |
sanity: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
components: rustfmt | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
components: rustfmt | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
check: | ||
if: github.ref != 'refs/heads/staging' | ||
needs: sanity | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
|
||
test: | ||
if: github.ref != 'refs/heads/staging' | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: build # needed by assert_cmd based tests | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --lib | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: build # needed by assert_cmd based tests | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --lib | ||
|
||
doctest: | ||
if: github.ref != 'refs/heads/staging' | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --doc | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --doc | ||
|
||
clippy: | ||
if: github.ref != 'refs/heads/staging' | ||
|
@@ -90,10 +90,10 @@ jobs: | |
- uses: actions/checkout@v1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
components: clippy | ||
override: true | ||
profile: minimal | ||
toolchain: nightly | ||
components: clippy | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: actions-rs/clippy-check@v1 | ||
with: | ||
|
@@ -113,54 +113,66 @@ jobs: | |
# FIXME: - macOS-latest | ||
- windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
|
||
success: # quick hack because bors wrongly detect matrix jobs status | ||
if: github.ref == 'refs/heads/staging' | ||
needs: full | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: exit 0 | ||
- run: exit 0 | ||
|
||
# Code documentation and coverage will be run only on main branch | ||
coverage: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: clean | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --all-features --no-fail-fast | ||
env: | ||
CARGO_INCREMENTAL: '0' | ||
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' | ||
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' | ||
- id: coverage | ||
uses: actions-rs/[email protected] | ||
- uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: ${{ steps.coverage.outputs.report }} | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: clean | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --all-features --no-fail-fast | ||
env: | ||
CARGO_INCREMENTAL: "0" | ||
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" | ||
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" | ||
- id: coverage | ||
uses: actions-rs/[email protected] | ||
- uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: ${{ steps.coverage.outputs.report }} | ||
|
||
doc: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: cargo doc --no-deps | ||
- uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages | ||
folder: target/doc |