-
Notifications
You must be signed in to change notification settings - Fork 0
23 lines (23 loc) · 1020 Bytes
/
cargo.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
on: push
env:
CARGO_TERM_COLOR: always
jobs:
cargo:
name: Cargo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: swatinem/rust-cache@v2
- uses: cachix/install-nix-action@v27
- uses: cachix/cachix-action@v15
with:
name: devenv
- run: nix profile install nixpkgs#devenv
- shell: devenv shell bash -- -e {0}
run: |
devenv up -d
sqlx migrate run
cargo fmt --check
cargo build
cargo clippy --all-features --message-format=json-diagnostic-rendered-ansi | jq -r 'select(.reason == "compiler-message").message | . as {message: $message, level: $level, rendered: $rendered} | .spans[] | select(.is_primary == true) | "::" + $level + " file=" + .file_name + ",col=" + (.column_start | tostring) + ",endColumn=" + (.column_end | tostring) + ",line=" + (.line_start | tostring) + ",endLine=" + (.line_end | tostring) + "::" + $message + "\n" + $rendered'
exit ${PIPESTATUS[0]}