fix: env #33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| # Single gate that decides whether downstream jobs run. Centralises | |
| # fork-protection so each new job only needs `needs: gate` — no | |
| # duplicated `if:` blocks. Runs on a GitHub-hosted runner so forked | |
| # PRs never reach the self-hosted infrastructure even to evaluate the | |
| # condition; if the gate is skipped, every dependent job is skipped | |
| # transitively. | |
| gate: | |
| name: Gate · trusted source check | |
| runs-on: ubuntu-latest | |
| if: >- | |
| github.event_name == 'push' || ( | |
| github.event.pull_request.head.repo.full_name == github.repository | |
| && github.actor != 'dependabot[bot]' | |
| && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) | |
| ) | |
| steps: | |
| - run: echo "Trusted source — downstream jobs are allowed to run." | |
| build-test-lint: | |
| needs: gate | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25.5' | |
| cache: true | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| gcc \ | |
| libwayland-dev \ | |
| libx11-dev \ | |
| libx11-xcb-dev \ | |
| libxkbcommon-x11-dev \ | |
| libgles2-mesa-dev \ | |
| libegl1-mesa-dev \ | |
| libffi-dev \ | |
| libxcursor-dev \ | |
| libvulkan-dev | |
| - name: Lint (go vet) | |
| run: go vet ./... | |
| - name: Build | |
| run: go build -v -o bin/tracto ./cmd | |
| - name: Run tests | |
| run: go test -cover ./... |