2020-06-27 19:52:43 +03:00
|
|
|
name: Continuous master build
|
2020-06-29 15:11:00 +03:00
|
|
|
|
2020-06-27 19:52:43 +03:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-06-29 09:15:26 +03:00
|
|
|
|
2020-06-27 19:52:43 +03:00
|
|
|
jobs:
|
|
|
|
clippy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-10-30 01:38:34 +03:00
|
|
|
- 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
|
2023-11-11 11:45:24 +03:00
|
|
|
- run: |
|
2024-05-13 19:15:16 +03:00
|
|
|
sudo apt update && sudo apt install -y libnss-wrapper scdoc
|
2023-10-30 01:38:34 +03:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Test
|
2023-11-11 11:45:24 +03:00
|
|
|
env:
|
|
|
|
NSS_WRAPPER_PASSWD: contrib/fixtures/passwd
|
|
|
|
NSS_WRAPPER_GROUP: contrib/fixtures/group
|
2023-10-30 01:38:34 +03:00
|
|
|
run: |
|
|
|
|
cargo test
|
2023-11-11 11:45:24 +03:00
|
|
|
LD_PRELOAD=libnss_wrapper.so cargo test --features nsswrapper nsswrapper_
|
2024-05-13 19:15:16 +03:00
|
|
|
- name: Generate manpage
|
|
|
|
run: |
|
|
|
|
scdoc < contrib/man/tuigreet-1.scd > /dev/null
|
2020-06-29 18:37:27 +03:00
|
|
|
|
2020-06-27 19:52:43 +03:00
|
|
|
build:
|
2020-06-29 09:15:26 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
arch:
|
2024-04-25 21:32:12 +03:00
|
|
|
- { name: "x86_64", os: "ubuntu-latest", target: "x86_64-unknown-linux-gnu", cross: false }
|
2020-06-29 09:15:26 +03:00
|
|
|
runs-on: ${{ matrix.arch.os }}
|
2020-06-27 19:52:43 +03:00
|
|
|
steps:
|
2023-10-30 01:38:34 +03:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
2020-06-27 19:52:43 +03:00
|
|
|
with:
|
2023-10-30 01:38:34 +03:00
|
|
|
shared-key: cargo-cache-${{ matrix.arch.target }}
|
2020-06-29 09:15:26 +03:00
|
|
|
- name: Build
|
2023-10-30 01:38:34 +03:00
|
|
|
run: |
|
|
|
|
cargo build --release --target=${{ matrix.arch.target }}
|
2020-06-29 09:15:26 +03:00
|
|
|
- name: Rename artifact
|
2023-10-30 01:38:34 +03:00
|
|
|
run: mv target/${{ matrix.arch.target }}/release/tuigreet target/${{ matrix.arch.target }}/release/tuigreet-dev-${{ matrix.arch.name }}
|
2020-06-29 09:15:26 +03:00
|
|
|
- name: Upload artifact
|
2024-04-25 21:32:12 +03:00
|
|
|
uses: actions/upload-artifact@v4
|
2020-06-29 09:15:26 +03:00
|
|
|
with:
|
2023-10-30 01:38:34 +03:00
|
|
|
name: tuigreet-dev-${{ matrix.arch.name }}
|
|
|
|
path: target/${{ matrix.arch.target }}/release/tuigreet-dev-${{ matrix.arch.name }}
|
2020-06-29 09:15:26 +03:00
|
|
|
|
|
|
|
package:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
steps:
|
|
|
|
- name: Download artifacts
|
2024-04-25 21:32:12 +03:00
|
|
|
uses: actions/download-artifact@v4
|
2020-06-29 09:15:26 +03:00
|
|
|
with:
|
|
|
|
path: target/out
|
2020-06-27 19:52:43 +03:00
|
|
|
- name: Create release
|
2023-10-30 14:41:45 +03:00
|
|
|
uses: ncipollo/release-action@v1
|
2020-06-27 19:52:43 +03:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2023-10-30 14:41:45 +03:00
|
|
|
name: tip
|
|
|
|
prerelease: true
|
|
|
|
tag: tip
|
|
|
|
commit: ${{ github.sha }}
|
|
|
|
artifacts: target/out/*/*
|
|
|
|
allowUpdates: true
|
|
|
|
removeArtifacts: true
|