-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (63 loc) · 1.61 KB
/
rust.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Rust
on:
pull_request:
branches:
- main
push:
branches:
- main
- staging
- trying
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
runs-on: ${{ matrix.os }}
env:
AUTHY_API_KEY: anything-here
steps:
- name: Install dependencies
if: "${{ matrix.os == 'ubuntu-latest'}}"
run: sudo apt install libdbus-1-dev
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Clippy
run: cargo clippy
- name: Run tests
shell: bash
run: RUST_BACKTRACE=full cargo test --verbose
- name: Formatting
run: cargo fmt -- --check
release:
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
- name: Create bump and changelog
# After commitizen can bump Cargo.lock files, rever this to their own implementation
uses: jaysonsantos/commitizen-action@custom-commitizen-install
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
changelog_increment_filename: body.md
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: "body.md"
tag_name: ${{ env.REVISION }}
env:
GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }}
ci-success:
name: ci
if: ${{ success() }}
needs:
- build
runs-on: ubuntu-latest
steps:
- name: CI succeeded
run: exit 0