diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 40bab72..b8855c9 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -13,31 +13,40 @@ env: jobs: test: name: Test - runs-on: rust + runs-on: docker + container: rust:1-bookworm steps: - - name: Clone repo - run: | - git clone --depth 1 --branch ${{ github.ref_name }} \ - ${{ github.server_url }}/${{ github.repository }}.git . + - name: Install node (required by JS-based actions) + run: apt-get update && apt-get install -y --no-install-recommends nodejs + + - uses: actions/checkout@v4 + + - name: Cache cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + cargo-${{ runner.os }}- - name: Run tests run: cargo test --all build: name: Build and push image - runs-on: golang + runs-on: docker needs: test if: github.event_name == 'push' && github.ref == 'refs/heads/main' - container: - image: docker:27-cli - volumes: - - /docker-certs/client:/docker-certs/client:ro + container: docker:27-cli env: - DOCKER_HOST: tcp://localhost:2376 + DOCKER_HOST: tcp://forgejo-runner-dind.cicd.svc.cluster.local:2376 DOCKER_TLS_VERIFY: "1" DOCKER_CERT_PATH: /docker-certs/client steps: - - name: install node (required by JS-based actions) + - name: Install node (required by JS-based actions) run: apk add --no-cache nodejs git - uses: actions/checkout@v4