Files
pkh/.github/workflows/ci.yml
T

66 lines
1.8 KiB
YAML
Raw Normal View History

2025-11-28 15:32:55 +01:00
name: CI
on:
push:
branches: [ "main", "ci-test" ]
2025-11-28 15:32:55 +01:00
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
container:
image: ubuntu:24.04
options: --privileged --cap-add SYS_ADMIN --security-opt apparmor:unconfined
2025-11-28 15:32:55 +01:00
steps:
- name: Set up container image
run: |
apt-get update
apt-get install -y nodejs sudo curl wget ca-certificates build-essential
2025-11-28 15:32:55 +01:00
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
2025-11-30 15:06:09 +01:00
with:
2026-01-11 12:18:19 +01:00
components: rustfmt, clippy
2025-11-30 15:06:09 +01:00
- name: Check format
run: cargo fmt --check
2025-12-02 20:48:38 +01:00
- name: Install build dependencies
run: |
sudo apt-get update
2026-01-06 18:17:01 +01:00
sudo apt-get install -y pkg-config libssl-dev libgpg-error-dev libgpgme-dev
2025-11-28 15:32:55 +01:00
- name: Build
run: cargo build
env:
2026-01-11 12:22:00 +01:00
RUSTFLAGS: -Dwarnings
- name: Lint
run: cargo clippy --all-targets --all-features
env:
2026-01-11 12:22:00 +01:00
RUSTFLAGS: -Dwarnings
2025-11-28 15:32:55 +01:00
- name: Install runtime system dependencies
run: |
sudo apt-get update
sudo apt-get install -y git pristine-tar sbuild mmdebstrap util-linux dpkg-dev
- name: Setup subuid/subgid
run: |
usermod --add-subuids 100000-200000 --add-subgids 100000-200000 ${USER:-root}
- name: Run tests with verbose logging (timeout 30min)
env:
RUST_LOG: debug
run: timeout 30m cargo test -- --nocapture
2026-01-26 14:02:38 +01:00
snap:
needs: build
2026-01-26 17:48:05 +01:00
runs-on: ubuntu-latest
2026-01-26 17:21:26 +01:00
outputs:
snap-file: ${{ steps.build-snap.outputs.snap }}
2026-01-26 14:02:38 +01:00
steps:
- uses: actions/checkout@v4
2026-01-26 17:21:26 +01:00
- uses: snapcore/action-build@v1
id: build-snap
2026-01-26 14:02:38 +01:00
- uses: actions/upload-artifact@v3
with:
name: snap
2026-01-26 17:21:26 +01:00
path: ${{ steps.build-snap.outputs.snap }}