-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (52 loc) · 1.53 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
name: Rust
on:
push:
branches: [ "main" ]
tags: [ "release/v*" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update -q -y && sudo apt-get upgrade -y
sudo apt-get install -y libxdo-dev libxkbcommon-dev
- name: Build (all features)
run: cargo build --all-features
- name: Build (no features)
run: cargo build --no-default-features
- name: Build (default)
run: cargo build
- name: Run tests
run: cargo test --verbose
- name: Cargo check
run: cargo check
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint
uses: giraffate/clippy-action@v1
publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/release/v')
needs: [build, lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Authenticate
run: cargo login ${{ secrets.CARGO_PUBLISH_TOKEN }}
- name: Install Dependencies
run: |
sudo apt-get update -q -y && sudo apt-get upgrade -y
sudo apt-get install -y libxdo-dev libxkbcommon-dev
- name: Publish
run: cargo publish