|
1 | 1 | name: CI
|
2 | 2 |
|
3 |
| -permissions: |
4 |
| - contents: write |
5 |
| - |
6 | 3 | on:
|
7 | 4 | push:
|
8 | 5 | branches:
|
9 | 6 | - "**" # Trigger on every branch push, excluding tags
|
10 | 7 | tags:
|
11 | 8 | - v[0-9]+.* # Trigger for tag pushes
|
| 9 | +env: |
| 10 | + CARGO_TERM_COLOR: always |
| 11 | + RUSTFLAGS: "-Dwarnings" |
12 | 12 |
|
13 | 13 | jobs:
|
14 |
| - # Job for running tests |
15 |
| - test: |
16 |
| - runs-on: ubuntu-latest |
| 14 | + check: |
| 15 | + runs-on: ubuntu-22.04 |
17 | 16 | steps:
|
18 |
| - - name: Checkout code |
19 |
| - uses: actions/checkout@v4 |
20 |
| - |
21 |
| - - name: Set up Rust |
22 |
| - uses: actions-rs/toolchain@v1 |
| 17 | + - uses: actions/checkout@v2 |
| 18 | + - uses: actions-rs/toolchain@v1 |
23 | 19 | with:
|
| 20 | + profile: minimal |
24 | 21 | toolchain: stable
|
25 | 22 | override: true
|
| 23 | + - uses: actions-rs/cargo@v1 |
| 24 | + with: |
| 25 | + command: check |
| 26 | + args: --all-features --verbose |
26 | 27 |
|
27 |
| - - name: Run tests |
28 |
| - run: cargo test --all |
| 28 | + test: |
| 29 | + runs-on: ubuntu-22.04 |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v2 |
| 32 | + - uses: actions-rs/toolchain@v1 |
| 33 | + with: |
| 34 | + profile: minimal |
| 35 | + toolchain: stable |
| 36 | + override: true |
| 37 | + - uses: actions-rs/cargo@v1 |
| 38 | + with: |
| 39 | + command: test |
| 40 | + args: --all-features --verbose |
29 | 41 |
|
30 |
| - create-release: |
31 |
| - if: startsWith(github.ref, 'refs/tags/') # Run only for tags |
32 |
| - runs-on: ubuntu-latest |
33 |
| - needs: test |
| 42 | + clippy: |
| 43 | + runs-on: ubuntu-22.04 |
34 | 44 | steps:
|
35 |
| - - uses: actions/checkout@v4 |
36 |
| - - uses: taiki-e/create-gh-release-action@v1 |
| 45 | + - uses: actions/checkout@v2 |
| 46 | + - uses: actions-rs/toolchain@v1 |
| 47 | + with: |
| 48 | + profile: minimal |
| 49 | + toolchain: stable |
| 50 | + components: clippy |
| 51 | + override: true |
| 52 | + - uses: actions-rs/cargo@v1 |
37 | 53 | with:
|
38 |
| - changelog: CHANGELOG.md |
39 |
| - token: ${{ secrets.GITHUB_TOKEN }} |
| 54 | + command: clippy |
| 55 | + args: --all-features --verbose |
40 | 56 |
|
41 |
| - upload-assets: |
42 |
| - if: startsWith(github.ref, 'refs/tags/') # Run only for tags |
43 |
| - needs: create-release |
44 |
| - strategy: |
45 |
| - matrix: |
46 |
| - include: |
47 |
| - - os: ubuntu-latest |
48 |
| - archive-suffix: "ubuntu-latest" |
49 |
| - - os: ubuntu-20.04 |
50 |
| - archive-suffix: "ubuntu-20.04" |
51 |
| - - os: macos-latest |
52 |
| - archive-suffix: "" |
53 |
| - - os: windows-latest |
54 |
| - archive-suffix: "" |
55 |
| - runs-on: ${{ matrix.os }} |
| 57 | + publish: |
| 58 | + runs-on: ubuntu-22.04 |
| 59 | + if: github.ref_type == 'tag' |
56 | 60 | steps:
|
57 |
| - - uses: actions/checkout@v4 |
58 |
| - - uses: taiki-e/upload-rust-binary-action@v1 |
| 61 | + - uses: actions/checkout@v2 |
| 62 | + - uses: actions-rs/toolchain@v1 |
| 63 | + with: |
| 64 | + profile: minimal |
| 65 | + toolchain: stable |
| 66 | + override: true |
| 67 | + - uses: katyo/publish-crates@v2 |
59 | 68 | with:
|
60 |
| - archive: $bin-$target${{ matrix.archive-suffix }} |
61 |
| - bin: dkms |
62 |
| - tar: unix |
63 |
| - zip: windows |
64 |
| - token: ${{ secrets.GITHUB_TOKEN }} |
| 69 | + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
0 commit comments