|
| 1 | +name: CI |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - master |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + |
| 9 | +env: |
| 10 | + # https://github.com/actions/setup-go#supported-version-syntax |
| 11 | + # ex: |
| 12 | + # - 1.18beta1 -> 1.18.0-beta.1 |
| 13 | + # - 1.18rc1 -> 1.18.0-rc.1 |
| 14 | + GO_VERSION: '1.24' |
| 15 | + |
| 16 | +jobs: |
| 17 | + # Check if there is any dirty change for go mod tidy |
| 18 | + go-mod: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + - uses: actions/setup-go@v5 |
| 23 | + with: |
| 24 | + go-version: ${{ env.GO_VERSION }} |
| 25 | + - name: Check go mod |
| 26 | + run: | |
| 27 | + go mod tidy |
| 28 | + git diff --exit-code go.mod |
| 29 | + git diff --exit-code go.sum |
| 30 | +
|
| 31 | + # Checks: GitHub action assets |
| 32 | + check-generated: |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v4 |
| 36 | + with: |
| 37 | + fetch-depth: 0 |
| 38 | + - uses: actions/setup-go@v5 |
| 39 | + with: |
| 40 | + go-version: ${{ env.GO_VERSION }} |
| 41 | + - name: Check generated files are up-to-date |
| 42 | + run: make fast_check_generated |
| 43 | + env: |
| 44 | + # needed for github-action-config.json generation |
| 45 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 46 | + |
| 47 | + check-local-install-script: |
| 48 | + name: Installation script (local) |
| 49 | + strategy: |
| 50 | + matrix: |
| 51 | + os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest] |
| 52 | + runs-on: ${{ matrix.os }} |
| 53 | + steps: |
| 54 | + - uses: actions/checkout@v4 |
| 55 | + - name: Check installation script |
| 56 | + run: cat ./install.sh | sh -s -- -d -b "./install-golangci-lint" |
| 57 | + |
| 58 | + # Note: the command `run` is tested by the other workflows (`make test`). |
| 59 | + check-commands: |
| 60 | + runs-on: ubuntu-latest |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@v4 |
| 63 | + - uses: actions/setup-go@v5 |
| 64 | + with: |
| 65 | + go-version: ${{ env.GO_VERSION }} |
| 66 | + - name: Build golangci-lint |
| 67 | + run: make build |
| 68 | + |
| 69 | + - run: ./golangci-lint |
| 70 | + |
| 71 | + - run: ./golangci-lint fmt |
| 72 | + - run: ./golangci-lint fmt --diff |
| 73 | + |
| 74 | + - run: ./golangci-lint cache |
| 75 | + - run: ./golangci-lint cache status |
| 76 | + - run: ./golangci-lint cache clean |
| 77 | + |
| 78 | + - run: ./golangci-lint completion |
| 79 | + - run: ./golangci-lint completion bash |
| 80 | + - run: ./golangci-lint completion bash --no-descriptions |
| 81 | + - run: ./golangci-lint completion zsh |
| 82 | + - run: ./golangci-lint completion zsh --no-descriptions |
| 83 | + - run: ./golangci-lint completion fish |
| 84 | + - run: ./golangci-lint completion fish --no-descriptions |
| 85 | + - run: ./golangci-lint completion powershell |
| 86 | + - run: ./golangci-lint completion powershell --no-descriptions |
| 87 | + |
| 88 | + - run: ./golangci-lint config |
| 89 | + - run: ./golangci-lint config path |
| 90 | + - run: ./golangci-lint config path --json |
| 91 | + # TODO(ldez) after v2: golangci.next.jsonschema.json -> golangci.jsonschema.json |
| 92 | + - run: ./golangci-lint config verify --schema jsonschema/golangci.next.jsonschema.json |
| 93 | + |
| 94 | + - run: ./golangci-lint help |
| 95 | + - run: ./golangci-lint help linters |
| 96 | + - run: ./golangci-lint help linters --json |
| 97 | + - run: ./golangci-lint help formatters |
| 98 | + - run: ./golangci-lint help formatters --json |
| 99 | + - run: ./golangci-lint linters |
| 100 | + - run: ./golangci-lint linters --json |
| 101 | + - run: ./golangci-lint formatters |
| 102 | + - run: ./golangci-lint formatters --json |
| 103 | + - run: ./golangci-lint version |
| 104 | + - run: ./golangci-lint version --short |
| 105 | + - run: ./golangci-lint version --debug |
| 106 | + - run: ./golangci-lint version --json |
| 107 | + - run: ./golangci-lint version --json --debug |
0 commit comments