nix-weather/.forgejo/workflows/unit-tests.yml
Christina Sørensen 8fb36ace8e
Some checks failed
/ test (push) Successful in 1s
Conventional Commits / Conventional Commits (pull_request) Failing after 3s
/ Build Nix package (pull_request) Failing after 3s
/ Flake Checker (pull_request) Failing after 3s
/ Check Nix Flake (pull_request) Failing after 2s
Security audit / security_audit (push) Failing after 3s
Unit tests / unit-tests (native, 1.70.0) (pull_request) Has been cancelled
Unit tests / unit-tests (native, beta) (pull_request) Has been cancelled
Unit tests / unit-tests (native, nightly) (pull_request) Has been cancelled
Unit tests / unit-tests (native, stable) (pull_request) Has been cancelled
ci: port github runners to forgejo
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2024-09-05 18:40:34 +02:00

51 lines
1.3 KiB
YAML

# SPDX-FileCopyrightText: 2024 Christina Sørensen
#
# SPDX-License-Identifier: EUPL-1.2
name: Unit tests
on:
push:
branches: [main]
paths:
- '.github/workflows/unit-tests.yml'
- 'src/**'
- 'Cargo.*'
- build.rs
pull_request:
branches: [main]
paths:
- '.github/workflows/unit-tests.yml'
- 'src/**'
- 'Cargo.*'
- build.rs
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: --deny warnings
jobs:
unit-tests:
runs-on: ${{ matxrix.os }}
continue-on-error: ${{ matrix.rust == 'nightly' }}
strategy:
matrix:
os: [native]
rust: [1.70.0, stable, beta, nightly]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- run: rustup toolchain install ${{ matrix.rust }} --profile minimal
- uses: Swatinem/rust-cache@v2
- name: Install cargo-hack
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
command: cargo install cargo-hack
- name: Run rustfmt checks
run: cargo fmt --check
- name: Run clippy lints
run: cargo clippy -- -D warnings
- name: Run unit tests
run: cargo hack test