-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (116 loc) · 3.86 KB
/
Copy pathci.yml
File metadata and controls
126 lines (116 loc) · 3.86 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: CI
on:
push:
pull_request:
env:
RUSTFLAGS: -Dwarnings
RUST_BACKTRACE: full
PACKAGES: gnome-devel libadwaita-1-dev
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: sfackler/actions/rustup@master
- run: cargo fmt --all -- --check
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt-get update && sudo apt-get install $PACKAGES
- uses: sfackler/actions/rustup@master
- run: echo "::set-output name=version::$(rustc --version)"
id: rust-version
- uses: Swatinem/rust-cache@v2
with:
key: "clippy"
- run: cargo clippy --all --all-targets
# Unfortunately building on Windows is very hard, because of the hard GTK dependencies installation.
# 1. Install msys2
# 2. Install GTK dependencies via pacman
# 3. Install Cargo and Rust via rustup
# windows:
# name: windows
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v3
# - uses: sfackler/actions/rustup@master
# - run: echo "::set-output name=version::$(rustc --version)"
# id: rust-version
# - uses: actions/cache@v3
# with:
# path: ~/.cargo
# key: cargo-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
# restore-keys: |
# cargo-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-
# cargo-${{ runner.os }}-
# - uses: actions/cache@v3
# with:
# path: target
# key: target-${{ github.job }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
# restore-keys: |
# cargo-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-
# cargo-${{ runner.os }}-
# - run: cargo test
# - run: cargo build --release
# - uses: actions/upload-artifact@v3
# with:
# name: windows
# path: target/release/firelaunch.exe
linux:
name: linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: sfackler/actions/rustup@master
- run: echo "::set-output name=version::$(rustc --version)"
id: rust-version
- run: rustup target add x86_64-unknown-linux-gnu
- run: sudo apt-get update && sudo apt-get install $PACKAGES
- uses: Swatinem/rust-cache@v2
with:
key: "linux"
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- run: cargo test --target x86_64-unknown-linux-gnu
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
- run: cargo build --target x86_64-unknown-linux-gnu --release
- uses: actions/upload-artifact@v3
with:
name: linux
path: target/x86_64-unknown-linux-gnu/release/firelaunch
nixpkgs-fmt:
name: nixpkgs-fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v19
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: nix-shell -p nixpkgs-fmt --run 'nixpkgs-fmt --check .'
nix:
name: nix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v19
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v12
with:
name: firesquare
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- run: nix build .