Files
pomomon-garden/.gitea/workflows/ci.yaml
2025-12-21 00:05:46 +01:00

69 lines
2.1 KiB
YAML

name: Gitea CI
on:
push:
branches:
- 'main'
- 'dev'
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
container:
image: rust:slim
steps:
- name: Install System Dependencies
run: |
apt-get update -yq
apt-get install -yq git g++ pkg-config libx11-dev libasound2-dev libudev-dev libxkbcommon-x11-0 libwayland-client-dev nodejs
- name: Checkout
uses: actions/checkout@v4
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Run Tests
run: cargo test --verbose
build:
name: Build Linux
needs: test
runs-on: ubuntu-latest
container:
image: rust:slim
steps:
- name: Install System Dependencies
run: |
apt-get update -yq
apt-get install -yq git g++ pkg-config libx11-dev libasound2-dev libudev-dev libxkbcommon-x11-0 libwayland-client-dev nodejs
- name: Checkout
uses: actions/checkout@v4
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Build Release
run: cargo build --release --target x86_64-unknown-linux-gnu
- name: Get Short SHA
id: slug
run: echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: pomomon-garden-linux-x86_64-${{ steps.slug.outputs.sha8 }}
path: target/x86_64-unknown-linux-gnu/release/pomomon-garden
retention-days: 14