Update CI.

Update checkoud, Use @dtolnay s rust-toolchain, and a problem-matcher.
This commit is contained in:
Rasmus Kaj 2023-01-28 17:36:13 +01:00
parent d3adaa7679
commit b60cf29e72
2 changed files with 39 additions and 34 deletions

View File

@ -5,48 +5,32 @@ on: [push, pull_request]
name: CI
jobs:
fmt:
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
components: rustfmt
- run: echo "::add-matcher::.github/workflows/rust-problem-matcher.json"
- run: cargo fmt --all -- --check
- name: Install rustfmt
run: rustup component add rustfmt
- name: Run cargo fmt
uses: actions-rs/cargo@v1
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
command: fmt
args: --all -- --check
components: clippy
- run: echo "::add-matcher::.github/workflows/rust-problem-matcher.json"
- run: cargo clippy --all-features
test:
name: Test Suite
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: echo "::add-matcher::.github/workflows/rust-problem-matcher.json"
- run: cargo test -q

View File

@ -0,0 +1,21 @@
{
"problemMatcher": [
{
"owner": "rust",
"pattern": [
{
"regexp": "^(?:\\x1b\\[[\\d;]+m)*(warning|warn|error)(?:\\x1b\\[[\\d;]+m)*(\\[(.*)\\])?(?:\\x1b\\[[\\d;]+m)*:(?:\\x1b\\[[\\d;]+m)* ([^\\x1b]*)(?:\\x1b\\[[\\d;]+m)*$",
"severity": 1,
"message": 4,
"code": 3
},
{
"regexp": "^(?:\\x1b\\[[\\d;]+m)*\\s*(?:\\x1b\\[[\\d;]+m)*\\s*--> (?:\\x1b\\[[\\d;]+m)*(.*):(\\d*):(\\d*)(?:\\x1b\\[[\\d;]+m)*$",
"file": 1,
"line": 2,
"column": 3
}
]
}
]
}