-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (47 loc) · 1.42 KB
/
test-and-lint.yml
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
name: 🧪 Test and Lint
on:
push:
branches-ignore: [wip/**]
jobs:
test:
strategy:
matrix:
os: [[🐧, Ubuntu], [🍎, macOS], [🪟, Windows]]
toolchain: ["stable", "beta", "nightly"]
name: 🦀 ${{ matrix.toolchain }} on ${{ matrix.os[0] }} ${{ matrix.os[1] }}
runs-on: ${{ matrix.os[1] }}-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with: { toolchain: "${{ matrix.toolchain }}" }
- name: Test
run: make test
lint:
name: 🔎 Lint and Cover
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Run pre-commit
uses: pre-commit/[email protected]
- uses: actions-rust-lang/audit@v1
name: Audit Rust Dependencies
- name: Generate Coverage
run: make cover RUST_BACKTRACE=1
- name: Publish Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: pgxn/meta
files: target/cover/coveralls
- name: Clear Badge Cache
uses: kevincobain2000/action-camo-purge@v1
if: github.ref_name == 'main'