From 1f1b0abf216237b87c4f0dae81b3e47495ec5e0d Mon Sep 17 00:00:00 2001 From: demenik Date: Sat, 20 Dec 2025 23:25:38 +0100 Subject: [PATCH] build: Add gitea CI for linux builds and testing --- .gitea/workflows/ci.yaml | 69 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .gitea/workflows/ci.yaml diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..9d93261 --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,69 @@ +name: Gitea CI +on: + push: + branches: + - 'main' + - 'dev' +jobs: + build: + name: Build Linux + runs-on: ubuntu-latest + container: + image: rust:slim + if: github.ref == 'refs/heads/main' + 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 + - 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 + 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 + - 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