chore(deps): bump actions/checkout from 3 to 4 #86
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
--- | |
name: ci | |
"on": | |
push: | |
branches: | |
- 'master' | |
pull_request: | |
env: | |
CARGO_INCREMENTAL: 0 | |
jobs: | |
# TODO: Fix automatically | |
lint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- uses: r7kamura/rust-problem-matchers@v1 | |
- run: cargo fmt --all -- --check | |
- uses: xt0rted/markdownlint-problem-matcher@v2 | |
- uses: DavidAnson/markdownlint-cli2-action@v10 | |
with: | |
globs: "**/*.md" | |
# FIXME: Add yamllint problem matcher | |
- run: yamllint -s . | |
deny: | |
runs-on: ubuntu-22.04 | |
needs: | |
- lint | |
strategy: | |
matrix: | |
checks: | |
- advisories | |
- bans licenses sources | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: EmbarkStudios/cargo-deny-action@v1 | |
with: | |
command: check ${{ matrix.checks }} | |
sort: | |
runs-on: ubuntu-22.04 | |
needs: | |
- lint | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-sort | |
- run: cargo sort --workspace --grouped --check >/dev/null | |
# TODO: Fix automatically | |
clippy: | |
runs-on: ubuntu-22.04 | |
needs: | |
- lint | |
strategy: | |
matrix: | |
rust: | |
- stable | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
components: clippy | |
- uses: r7kamura/rust-problem-matchers@v1 | |
- run: | | |
cargo +${{ matrix.rust }} clippy --all --all-features -- -D warnings | |
# TODO: Fix automatically, or post GH-suggestions comments | |
build: | |
runs-on: ubuntu-22.04 | |
needs: | |
- lint | |
strategy: | |
matrix: | |
rust: | |
- stable | |
- nightly-2023-03-23 | |
flags: | |
- "" | |
- "--release" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: r7kamura/rust-problem-matchers@v1 | |
- run: cargo +${{ matrix.rust }} build ${{ matrix.flags }} | |
test: | |
runs-on: ubuntu-22.04 | |
needs: | |
- lint | |
strategy: | |
matrix: | |
rust: | |
- stable | |
- nightly-2023-03-23 | |
flags: | |
- "" | |
- "--release" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: r7kamura/rust-problem-matchers@v1 | |
- run: cargo +${{ matrix.rust }} test ${{ matrix.flags }} | |
bench: | |
runs-on: ubuntu-22.04 | |
needs: | |
- lint | |
strategy: | |
matrix: | |
rust: | |
- nightly-2023-03-23 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: r7kamura/rust-problem-matchers@v1 | |
- run: cargo +${{ matrix.rust }} bench | |
no-asm-tests: | |
runs-on: ubuntu-22.04 | |
needs: | |
- lint | |
strategy: | |
matrix: | |
rust: | |
- stable | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: r7kamura/rust-problem-matchers@v1 | |
- run: | | |
sudo apt-get update && \ | |
sudo apt-get install -y libgsl-dev && \ | |
cd no-asm-tests && \ | |
cargo +${{ matrix.rust }} test --release | |
doc: | |
runs-on: ubuntu-22.04 | |
needs: | |
- lint | |
strategy: | |
matrix: | |
rust: | |
- stable | |
- beta | |
# Prevent beta docs warnings from causing CI failure | |
continue-on-error: ${{ matrix.rust == 'beta' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: r7kamura/rust-problem-matchers@v1 | |
- run: cargo +${{ matrix.rust }} doc --release --no-deps | |
coverage: | |
runs-on: ubuntu-22.04 | |
needs: | |
- lint | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: llvm-tools-preview | |
- uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-llvm-cov | |
- run: cargo llvm-cov --workspace --lcov --output-path lcov.info | |
- uses: codecov/codecov-action@v3 | |
with: | |
files: lcov.info | |
notify: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && failure() | |
needs: | |
- lint | |
- deny | |
- sort | |
- clippy | |
- build | |
- test | |
- doc | |
- coverage | |
steps: | |
- name: Notify Discord on failure | |
uses: sarisia/actions-status-discord@v1 | |
with: | |
webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
username: "Github Actions" | |
status: Failure | |
color: 0xff0000 | |
nodetail: true | |
# yamllint disable rule:line-length | |
title: "${{ github.repository }} ${{ github.workflow }} has failed on ${{ github.event_name }} to ${{ github.ref_name }}" | |
url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
description: > | |
[`@${{ github.actor }}`](${{ github.server_url }}/${{ github.actor }}) | |
was the last one to touch | |
[that repository](${{ github.server_url }}/${{ github.repository }}), | |
is all I'm saying. | |
avatar_url: "https://media0.giphy.com/media/oe33xf3B50fsc/200.gif" | |
# yamllint enable rule:line-length |