From 459c74822b8cff6690d8739e231881e65e7cef22 Mon Sep 17 00:00:00 2001 From: Tobias Klemp Date: Wed, 3 Dec 2025 21:02:27 +0100 Subject: [PATCH] feat: added first workflow --- .gitea/workflows/ci.yml | 120 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..7aae377 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,120 @@ +name: CI + +on: + push: + branches: [main, develop] + pull_request: + branches: [main, develop] + +jobs: + install: + runs-on: ubuntu-latest + container: + image: oven/bun:alpine + outputs: + cache-key: ${{ steps.cache-key.outputs.key }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Generate cache key + id: cache-key + run: echo "key=bun-${{ hashFiles('**/bun.lock') }}" >> $GITHUB_OUTPUT + + - name: Cache node_modules + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ steps.cache-key.outputs.key }} + restore-keys: | + bun- + + - name: Install dependencies + run: bun install --frozen-lockfile + + type-check: + runs-on: ubuntu-latest + container: + image: oven/bun:alpine + needs: install + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Restore node_modules + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ needs.install.outputs.cache-key }} + restore-keys: | + bun- + + - name: Run type checking + run: bun run check + + lint: + runs-on: ubuntu-latest + container: + image: oven/bun:alpine + needs: install + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Restore node_modules + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ needs.install.outputs.cache-key }} + restore-keys: | + bun- + + - name: Run linting + run: bun run lint + + format-check: + runs-on: ubuntu-latest + container: + image: oven/bun:alpine + needs: install + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Restore node_modules + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ needs.install.outputs.cache-key }} + restore-keys: | + bun- + + - name: Check formatting + run: bun exec prettier --check . + + build: + runs-on: ubuntu-latest + container: + image: oven/bun:alpine + needs: install + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Restore node_modules + uses: actions/cache@v4 + with: + path: node_modules + key: ${{ needs.install.outputs.cache-key }} + restore-keys: | + bun- + + - name: Build application + run: bun run build + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-output + path: build/ + retention-days: 7