diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml index 3e1466bf..3a1d5abe 100644 --- a/.forgejo/workflows/test.yml +++ b/.forgejo/workflows/test.yml @@ -149,6 +149,44 @@ jobs: go test ./act/container go test -timeout 30m ./act/runner/... + runner-integration-tests: + name: runner integration tests + if: vars.ROLE == 'forgejo-coding' + runs-on: lxc-bookworm + needs: [build-and-tests] + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: install docker + run: | + mkdir /etc/docker + cat > /etc/docker/daemon.json < cache_path_1/cache_content_1 +` + runWorkflow(populateYaml, "push", "refs/heads/main", "step 1: push cache populate expected to succeed") + + // Step 2: Validate that cache is accessible; mostly a sanity check that the test environment and mock context + // provides everything needed for the cache setup. + checkYaml := ` +name: Cache Testing Action +on: + push: +jobs: + job-cache-check-2: + runs-on: ubuntu-latest + steps: + - uses: actions/cache@v4 + with: + path: cache_path_1 + key: cache-key-1 + - run: | + [[ -f cache_path_1/cache_content_1 ]] && echo "Step 2: cache file found." || echo "Step 2: cache file missing!" + [[ -f cache_path_1/cache_content_1 ]] || exit 1 +` + runWorkflow(checkYaml, "push", "refs/heads/main", "step 2: push cache check expected to succeed") +}