Private
Public Access
1
0
Files
linux_patch_api/.github/workflows/ci.yml
Echo 2c870781ca
Some checks failed
CI/CD Pipeline / Code Format (push) Successful in 11s
CI/CD Pipeline / Clippy Lints (push) Successful in 10m35s
CI/CD Pipeline / Unit Tests (push) Successful in 10m59s
CI/CD Pipeline / Security Audit (push) Successful in 1m33s
CI/CD Pipeline / Build Debian Package (push) Successful in 1m58s
CI/CD Pipeline / Build RPM Package (push) Failing after 1m52s
CI/CD Pipeline / Build Alpine Package (push) Failing after 2s
CI/CD Pipeline / Build Arch Package (push) Failing after 2s
Fix all build jobs: add cargo build --release before helper scripts, add abuild to apk deps, remove sudo from build-arch.sh
2026-04-12 23:16:17 +00:00

178 lines
4.7 KiB
YAML

name: CI/CD Pipeline
on:
push:
branches: [ master, develop ]
tags: [ 'v*' ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
fmt:
name: Code Format
runs-on: linux
container: node:18
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
clippy:
name: Clippy Lints
runs-on: linux
container: node:18
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install system dependencies
run: |
apt-get update
apt-get install -y libsystemd-dev pkg-config
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
test:
name: Unit Tests
runs-on: linux
container: node:18
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install system dependencies
run: |
apt-get update
apt-get install -y libsystemd-dev pkg-config
- uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --all-features
- name: Upload coverage
uses: codecov/codecov-action@v4
if: always()
audit:
name: Security Audit
runs-on: linux
container: node:18
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install system dependencies
run: |
apt-get update
apt-get install -y libsystemd-dev pkg-config
- uses: dtolnay/rust-toolchain@stable
- name: Run cargo-audit
run: |
cargo install cargo-audit
cargo audit
# Debian/Ubuntu Package Build
build-deb:
name: Build Debian Package
runs-on: linux
container: node:18
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- name: Install build dependencies
run: |
apt-get update
apt-get install -y build-essential debhelper cargo rustc libsystemd-dev pkg-config
- name: Build Debian package
run: dpkg-buildpackage -us -uc -b
- name: Copy .deb to workspace
run: cp ../linux-patch-api_*.deb .
- name: Upload to releases (on tag)
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: linux-patch-api_*.deb
# RHEL/CentOS/Fedora Package Build
build-rpm:
name: Build RPM Package
runs-on: linux
container: node:18
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- name: Install RPM build tools
run: |
apt-get update
apt-get install -y rpm cargo rustc libsystemd-dev pkg-config
- name: Build release binary
run: cargo build --release
- name: Build RPM package
run: ./build-rpm.sh
- name: Upload to releases (on tag)
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: ~/rpmbuild/RPMS/x86_64/*.rpm
# Alpine Package Build
build-apk:
name: Build Alpine Package
runs-on: linux
container: alpine:latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install build dependencies
run: |
apk add --no-cache rust cargo musl-dev openssl-dev systemd-dev git nodejs npm abuild
- name: Build APK package
run: ./build-alpine.sh
- name: Upload to releases (on tag)
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: releases/*.apk
# Arch Linux Package Build
build-arch:
name: Build Arch Package
runs-on: linux
container: archlinux:latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install build dependencies
run: |
pacman -Syu --noconfirm rust cargo systemd git base-devel nodejs npm
- name: Build release binary
run: cargo build --release
- name: Build Arch package
run: ./build-arch.sh
- name: Upload to releases (on tag)
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: releases/*.pkg.tar.zst