File: lint_and_test.yml

package info (click to toggle)
rust-compile-commands 0.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 124 kB
  • sloc: makefile: 4
file content (53 lines) | stat: -rw-r--r-- 1,211 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Lint Code / Run Tests

on:
  workflow_call:
  workflow_dispatch:
  push:
    branches:
      - "*"
  pull_request:
    branches: ["main"]

concurrency:
  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always

jobs:
  tests:
    name: Run Unit Tests
    runs-on: ${{ matrix.os }}

    continue-on-error: ${{ matrix.rust == 'nightly' }}

    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        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

      - uses: actions/setup-python@v3

      - name: Set up Ruby on Windows
        if: runner.os == 'Windows'
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: '3.1'
          msys2: true

      - name: Install pre-commit dependencies
        run: python -m pip install pre-commit

      - uses: pre-commit/action@v3.0.1
        name: Run pre-commit hooks

      - name: Run Rust tests
        run: cargo test