mirror of
https://github.com/golangci/golangci-lint-action.git
synced 2026-06-14 10:16:28 +00:00
180 lines
5 KiB
YAML
180 lines
5 KiB
YAML
name: "build-and-test"
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
# make sure build/ci work properly
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: 24.x
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- run: |
|
|
npm install
|
|
npm run all
|
|
|
|
# Fail the build if there are changes.
|
|
- run: git diff --exit-code -- dist
|
|
|
|
# make sure the action works on a clean machine without building
|
|
test:
|
|
needs: [ build ]
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- ubuntu-22.04-arm
|
|
- macos-latest
|
|
- windows-latest
|
|
version:
|
|
- ""
|
|
- "latest"
|
|
- "v2.12"
|
|
- "v2.12.2"
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: 24.x
|
|
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
go-version: oldstable
|
|
- uses: ./
|
|
with:
|
|
version: ${{ matrix.version }}
|
|
args: --timeout=5m --issues-exit-code=0 ./fixtures/simple/...
|
|
only-new-issues: true
|
|
|
|
# make sure the action works on a clean machine without building (go-install mode)
|
|
test-go-install:
|
|
needs: [ build ]
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- ubuntu-22.04-arm
|
|
- macos-latest
|
|
- windows-latest
|
|
version:
|
|
- ""
|
|
- "latest"
|
|
- "v2.12.1"
|
|
- "c0d3ddc9cf3faa61a4e378e879ece580256d76e5"
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: 24.x
|
|
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
go-version: oldstable
|
|
- uses: ./
|
|
with:
|
|
version: ${{ matrix.version }}
|
|
args: --timeout=5m --issues-exit-code=0 ./fixtures/simple/...
|
|
only-new-issues: true
|
|
install-mode: goinstall
|
|
|
|
test-go-mod:
|
|
needs: [ build ]
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- ubuntu-22.04-arm
|
|
- macos-latest
|
|
- windows-latest
|
|
wd:
|
|
- fixtures/go-mod
|
|
- fixtures/go-tool
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: 24.x
|
|
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
go-version: oldstable
|
|
- uses: ./
|
|
with:
|
|
working-directory: ${{ matrix.wd }}
|
|
args: --timeout=5m --issues-exit-code=0 ./...
|
|
|
|
# make sure the action works on a clean machine with plugins
|
|
test-plugins:
|
|
needs: [ build ]
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- ubuntu-22.04-arm
|
|
- macos-latest
|
|
- windows-latest
|
|
version:
|
|
- ""
|
|
- "latest"
|
|
- "v2.12"
|
|
- "v2.12.1"
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: 24.x
|
|
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
go-version: oldstable
|
|
- uses: ./
|
|
with:
|
|
version: ${{ matrix.version }}
|
|
working-directory: fixtures/plugins
|
|
args: --timeout=5m --issues-exit-code=0 ./...
|
|
|
|
test-monorepo:
|
|
needs: [ build ]
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- ubuntu-22.04-arm
|
|
- macos-latest
|
|
- windows-latest
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: 24.x
|
|
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
go-version: oldstable
|
|
- uses: ./
|
|
with:
|
|
working-directory: fixtures/monorepo
|
|
experimental: "automatic-module-directories"
|
|
args: --timeout=5m --issues-exit-code=0 ./...
|