-
-
Notifications
You must be signed in to change notification settings - Fork 45
80 lines (75 loc) · 2.29 KB
/
tip.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Continuous master build
on:
push:
branches:
- master
jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Lint
run: |
cargo clippy
cargo clippy --release
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: |
sudo apt update && sudo apt install -y libnss-wrapper scdoc
- uses: Swatinem/rust-cache@v2
- name: Test
env:
NSS_WRAPPER_PASSWD: contrib/fixtures/passwd
NSS_WRAPPER_GROUP: contrib/fixtures/group
run: |
cargo test
LD_PRELOAD=libnss_wrapper.so cargo test --features nsswrapper nsswrapper_
- name: Generate manpage
run: |
scdoc < contrib/man/tuigreet-1.scd > /dev/null
build:
strategy:
matrix:
arch:
- { name: "x86_64", os: "ubuntu-latest", target: "x86_64-unknown-linux-gnu", cross: false }
runs-on: ${{ matrix.arch.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: cargo-cache-${{ matrix.arch.target }}
- name: Build
run: |
cargo build --release --target=${{ matrix.arch.target }}
- name: Rename artifact
run: mv target/${{ matrix.arch.target }}/release/tuigreet target/${{ matrix.arch.target }}/release/tuigreet-dev-${{ matrix.arch.name }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: tuigreet-dev-${{ matrix.arch.name }}
path: target/${{ matrix.arch.target }}/release/tuigreet-dev-${{ matrix.arch.name }}
package:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: target/out
- name: Create release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: tip
prerelease: true
tag: tip
commit: ${{ github.sha }}
artifacts: target/out/*/*
allowUpdates: true
removeArtifacts: true