From d9d9c033bb717ff6c574cb222200fecc41d1bcf4 Mon Sep 17 00:00:00 2001 From: Matthew L McPeak Date: Wed, 17 Jun 2026 15:31:24 -0400 Subject: [PATCH] fix: ci --- .forgejo/workflows/ci.yml | 147 ++++++++++++++++++++------------------ 1 file changed, 76 insertions(+), 71 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index db6ed94..3185673 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -1,89 +1,94 @@ name: ci on: - push: - tags: - - 'v*' - pull_request: + push: + tags: + - "v*" + pull_request: jobs: - test: - runs-on: self-hosted - container: git.mcpeakdev.com/mcpeakdev/rust-ci:latest - steps: - - name: Checkout - uses: actions/checkout@v4 + test: + runs-on: self-hosted + container: git.mcpeakdev.com/mcpeakdev/rust-ci:latest + steps: + - name: Checkout + uses: actions/checkout@v4 - - name: Cache cargo registry - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- + - name: Cache cargo registry + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- - - name: Check formatting - run: cargo fmt --check + - name: Check formatting + run: cargo fmt --check - - name: Clippy - run: cargo clippy -- -D warnings + - name: Clippy + run: cargo clippy -- -D warnings - - name: Run tests - run: cargo test + - name: Run tests + run: cargo test - build-ui: - runs-on: self-hosted - container: git.mcpeakdev.com/mcpeakdev/bun-ci:latest - steps: - - name: Checkout - uses: actions/checkout@v4 + build-ui: + runs-on: self-hosted + container: git.mcpeakdev.com/mcpeakdev/bun-ci:latest + steps: + - name: Checkout + uses: actions/checkout@v4 - - name: Install dependencies - run: bun install --frozen-lockfile - working-directory: ui + - name: Inject bunfig.toml + run: printf '[install.scopes]\n"@nychthemeron" = { token = "${BUN_AUTH_TOKEN}", url = "https://git.mcpeakdev.com/api/packages/McPeakDev/npm/" }\n' > /root/.bunfig.toml + env: + BUN_AUTH_TOKEN: ${{ secrets.BUN_AUTH_TOKEN }} - - name: Audit dependencies - run: bun audit || true - working-directory: ui + - name: Install dependencies + run: bun install --frozen-lockfile + working-directory: ui - - name: Type check - run: bun run build - working-directory: ui + - name: Audit dependencies + run: bun audit || true + working-directory: ui - publish: - needs: [test, build-ui] - if: startsWith(github.ref, 'refs/tags/v') - runs-on: self-hosted - container: git.mcpeakdev.com/mcpeakdev/docker-pub:latest - steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Type check + run: bun run build + working-directory: ui - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + publish: + needs: [test, build-ui] + if: startsWith(github.ref, 'refs/tags/v') + runs-on: self-hosted + container: git.mcpeakdev.com/mcpeakdev/docker-pub:latest + steps: + - name: Checkout + uses: actions/checkout@v4 - - name: Log in to registry - uses: docker/login-action@v3 - with: - registry: git.mcpeakdev.com - username: ${{ github.actor }} - password: ${{ secrets.FORGEJO_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: Extract image tag - id: meta - run: echo "tag=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" + - name: Log in to registry + uses: docker/login-action@v3 + with: + registry: git.mcpeakdev.com + username: ${{ github.actor }} + password: ${{ secrets.FORGEJO_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: . - file: Dockerfile - push: true - tags: | - git.mcpeakdev.com/mcpeakdev/mercury:${{ steps.meta.outputs.tag }} - git.mcpeakdev.com/mcpeakdev/mercury:latest - cache-from: type=registry,ref=git.mcpeakdev.com/mcpeakdev/mercury:latest - cache-to: type=inline + - name: Extract image tag + id: meta + run: echo "tag=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile + push: true + tags: | + git.mcpeakdev.com/mcpeakdev/mercury:${{ steps.meta.outputs.tag }} + git.mcpeakdev.com/mcpeakdev/mercury:latest + cache-from: type=registry,ref=git.mcpeakdev.com/mcpeakdev/mercury:latest + cache-to: type=inline