ci(forgejo): run the test job on the Linux runner only
- commit
- 042ef11dcec4f1fb10c947cdd9efcc381d745772
- author
- brice · · 2026-10-02 07:34 UTC
- parent
- ad3af57
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +50 -0
A .forgejo/workflows/ci.yml +50 -0
| @@ -0,0 +1,50 @@ | |||
| 1 | + | name: ci | |
| 2 | + | ||
| 3 | + | # Forgejo runs only this directory and ignores .github/workflows. The | |
| 4 | + | # self-hosted runner is Linux-only; macOS and Windows coverage stays in the | |
| 5 | + | # GitHub mirror's .github/workflows/ci.yml. | |
| 6 | + | on: | |
| 7 | + | push: | |
| 8 | + | branches: [main] | |
| 9 | + | pull_request: | |
| 10 | + | branches: [main] | |
| 11 | + | ||
| 12 | + | concurrency: | |
| 13 | + | group: ci-${{ github.ref }} | |
| 14 | + | cancel-in-progress: true | |
| 15 | + | ||
| 16 | + | jobs: | |
| 17 | + | test: | |
| 18 | + | name: test (linux) | |
| 19 | + | runs-on: ubuntu-latest | |
| 20 | + | steps: | |
| 21 | + | - uses: actions/checkout@v4 | |
| 22 | + | ||
| 23 | + | - name: set up go | |
| 24 | + | uses: actions/setup-go@v7 | |
| 25 | + | with: | |
| 26 | + | go-version: "1.26" | |
| 27 | + | cache: true | |
| 28 | + | ||
| 29 | + | - name: go vet | |
| 30 | + | run: go vet ./... | |
| 31 | + | ||
| 32 | + | - name: gofmt check | |
| 33 | + | run: | | |
| 34 | + | diff=$(gofmt -l .) | |
| 35 | + | if [ -n "$diff" ]; then | |
| 36 | + | echo "gofmt issues:" | |
| 37 | + | echo "$diff" | |
| 38 | + | exit 1 | |
| 39 | + | fi | |
| 40 | + | ||
| 41 | + | - name: go test | |
| 42 | + | run: go test -race ./... | |
| 43 | + | ||
| 44 | + | - name: release-version policy | |
| 45 | + | run: bash .github/scripts/next-release-tag_test.sh | |
| 46 | + | ||
| 47 | + | - name: golangci-lint | |
| 48 | + | uses: golangci/golangci-lint-action@v9.3.0 | |
| 49 | + | with: | |
| 50 | + | version: v2.12.2 | |
| @@ -0,0 +1,50 @@ | |||||
| 1 | + | name: ci | |||
| 2 | + | ||||
| 3 | + | # Forgejo runs only this directory and ignores .github/workflows. The | |||
| 4 | + | # self-hosted runner is Linux-only; macOS and Windows coverage stays in the | |||
| 5 | + | # GitHub mirror's .github/workflows/ci.yml. | |||
| 6 | + | on: | |||
| 7 | + | push: | |||
| 8 | + | branches: [main] | |||
| 9 | + | pull_request: | |||
| 10 | + | branches: [main] | |||
| 11 | + | ||||
| 12 | + | concurrency: | |||
| 13 | + | group: ci-${{ github.ref }} | |||
| 14 | + | cancel-in-progress: true | |||
| 15 | + | ||||
| 16 | + | jobs: | |||
| 17 | + | test: | |||
| 18 | + | name: test (linux) | |||
| 19 | + | runs-on: ubuntu-latest | |||
| 20 | + | steps: | |||
| 21 | + | - uses: actions/checkout@v4 | |||
| 22 | + | ||||
| 23 | + | - name: set up go | |||
| 24 | + | uses: actions/setup-go@v7 | |||
| 25 | + | with: | |||
| 26 | + | go-version: "1.26" | |||
| 27 | + | cache: true | |||
| 28 | + | ||||
| 29 | + | - name: go vet | |||
| 30 | + | run: go vet ./... | |||
| 31 | + | ||||
| 32 | + | - name: gofmt check | |||
| 33 | + | run: | | |||
| 34 | + | diff=$(gofmt -l .) | |||
| 35 | + | if [ -n "$diff" ]; then | |||
| 36 | + | echo "gofmt issues:" | |||
| 37 | + | echo "$diff" | |||
| 38 | + | exit 1 | |||
| 39 | + | fi | |||
| 40 | + | ||||
| 41 | + | - name: go test | |||
| 42 | + | run: go test -race ./... | |||
| 43 | + | ||||
| 44 | + | - name: release-version policy | |||
| 45 | + | run: bash .github/scripts/next-release-tag_test.sh | |||
| 46 | + | ||||
| 47 | + | - name: golangci-lint | |||
| 48 | + | uses: golangci/golangci-lint-action@v9.3.0 | |||
| 49 | + | with: | |||
| 50 | + | version: v2.12.2 | |||