diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index ea4143b61926..c695959536ae 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -11,36 +11,18 @@ jobs: name: Build and deploy documentation runs-on: ubuntu-latest env: + # https://github.com/actions/setup-go#supported-version-syntax + # ex: + # - 1.18beta1 -> 1.18.0-beta.1 + # - 1.18rc1 -> 1.18.0-rc.1 GO_VERSION: '1.23.0-rc.1' NODE_VERSION: '20.x' CGO_ENABLED: 0 - steps: - - name: Check out code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Go ${{ env.GO_VERSION }} - uses: actions/setup-go@v5 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - - - name: Cache Go modules - uses: actions/cache@v4 - with: - # In order: - # * Module download cache - # * Build cache (Linux) - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: docs-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - docs-${{ runner.os }}-go- - - - run: go mod download - - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 with: @@ -48,12 +30,14 @@ jobs: cache: npm cache-dependency-path: docs/package-lock.json + - run: go mod download + - run: npm install --legacy-peer-deps working-directory: ./docs - name: Build Documentation - run: npm run build working-directory: ./docs + run: npm run build - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v4 diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml index a90e0ccbe7e7..442a2559d524 100644 --- a/.github/workflows/post-release.yml +++ b/.github/workflows/post-release.yml @@ -11,16 +11,16 @@ jobs: runs-on: ubuntu-latest env: GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }} + # https://github.com/actions/setup-go#supported-version-syntax + # ex: + # - 1.18beta1 -> 1.18.0-beta.1 + # - 1.18rc1 -> 1.18.0-rc.1 + GO_VERSION: '1.23.0-rc.1' steps: - uses: actions/checkout@v4 - - name: Install Go - uses: actions/setup-go@v5 + - uses: actions/setup-go@v5 with: - # https://github.com/actions/setup-go#supported-version-syntax - # ex: - # - 1.18beta1 -> 1.18.0-beta.1 - # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.23.0-rc.1' + go-version: ${{ env.GO_VERSION }} - uses: actions/setup-node@v4 with: node-version: "15" @@ -49,14 +49,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }} steps: - uses: actions/checkout@v4 - - name: Install Go - uses: actions/setup-go@v5 + - uses: actions/setup-go@v5 with: - # https://github.com/actions/setup-go#supported-version-syntax - # ex: - # - 1.18beta1 -> 1.18.0-beta.1 - # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.23.0-rc.1' + go-version: ${{ env.GO_VERSION }} - name: Update GitHub Action config run: make assets/github-action-config.json @@ -77,14 +72,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }} steps: - uses: actions/checkout@v4 - - name: Install Go - uses: actions/setup-go@v5 + - uses: actions/setup-go@v5 with: - # https://github.com/actions/setup-go#supported-version-syntax - # ex: - # - 1.18beta1 -> 1.18.0-beta.1 - # - 1.18rc1 -> 1.18.0-rc.1 - go-version: '1.23.0-rc.1' + go-version: ${{ env.GO_VERSION }} - name: Update reference files run: cp .golangci.next.reference.yml .golangci.reference.yml @@ -110,6 +100,5 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} - steps: - run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "./install-golangci-lint" diff --git a/.github/workflows/pr-documentation.yml b/.github/workflows/pr-documentation.yml index a0eaa111a3a4..08cbe8d6f317 100644 --- a/.github/workflows/pr-documentation.yml +++ b/.github/workflows/pr-documentation.yml @@ -9,36 +9,19 @@ jobs: name: Build documentation runs-on: ubuntu-latest env: + # https://github.com/actions/setup-go#supported-version-syntax + # ex: + # - 1.18beta1 -> 1.18.0-beta.1 + # - 1.18rc1 -> 1.18.0-rc.1 GO_VERSION: '1.23.0-rc.1' NODE_VERSION: '20.x' CGO_ENABLED: 0 steps: - - name: Check out code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Go ${{ env.GO_VERSION }} - uses: actions/setup-go@v5 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - - - name: Cache Go modules - uses: actions/cache@v4 - with: - # In order: - # * Module download cache - # * Build cache (Linux) - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: docs-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - docs-${{ runner.os }}-go- - - - run: go mod download - - name: Use Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 with: @@ -46,6 +29,8 @@ jobs: cache: npm cache-dependency-path: docs/package-lock.json + - run: go mod download + - run: npm install --legacy-peer-deps working-directory: ./docs diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 79fe4d79ad96..024faa988213 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -6,6 +6,10 @@ on: pull_request: env: + # https://github.com/actions/setup-go#supported-version-syntax + # ex: + # - 1.18beta1 -> 1.18.0-beta.1 + # - 1.18rc1 -> 1.18.0-rc.1 GO_VERSION: '1.23.0-rc.1' jobs: @@ -13,16 +17,10 @@ jobs: go-mod: runs-on: ubuntu-latest steps: - - name: Install Go - uses: actions/setup-go@v5 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - # https://github.com/actions/setup-go#supported-version-syntax - # ex: - # - 1.18beta1 -> 1.18.0-beta.1 - # - 1.18rc1 -> 1.18.0-rc.1 go-version: ${{ env.GO_VERSION }} - - name: Checkout code - uses: actions/checkout@v4 - name: Check go mod run: | go mod tidy @@ -35,8 +33,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Go - uses: actions/setup-go@v5 + - uses: actions/setup-go@v5 with: # https://github.com/actions/setup-go#supported-version-syntax # ex: @@ -53,13 +50,8 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 - - name: Install Go - uses: actions/setup-go@v5 + - uses: actions/setup-go@v5 with: - # https://github.com/actions/setup-go#supported-version-syntax - # ex: - # - 1.18beta1 -> 1.18.0-beta.1 - # - 1.18rc1 -> 1.18.0-rc.1 go-version: ${{ env.GO_VERSION }} # test only the latest go version to speed up CI - name: Run tests run: make.exe test @@ -69,13 +61,8 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v4 - - name: Install Go - uses: actions/setup-go@v5 + - uses: actions/setup-go@v5 with: - # https://github.com/actions/setup-go#supported-version-syntax - # ex: - # - 1.18beta1 -> 1.18.0-beta.1 - # - 1.18rc1 -> 1.18.0-rc.1 go-version: ${{ env.GO_VERSION }} # test only the latest go version to speed up CI - name: Run tests run: make test @@ -90,39 +77,23 @@ jobs: - '1.23.0-rc.1' steps: - uses: actions/checkout@v4 - - name: Install Go - uses: actions/setup-go@v5 + - uses: actions/setup-go@v5 with: - # https://github.com/actions/setup-go#supported-version-syntax - # ex: - # - 1.18beta1 -> 1.18.0-beta.1 - # - 1.18rc1 -> 1.18.0-rc.1 go-version: ${{ matrix.golang }} - - uses: actions/cache@v4 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go-${{ matrix.golang }}- - name: Run tests run: make test + # Checks: GitHub action assets check_generated: - needs: golangci-lint # run after golangci-lint action to not produce duplicated errors runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Unshallow - run: git fetch --prune --unshallow - - name: Install Go - uses: actions/setup-go@v5 with: - # https://github.com/actions/setup-go#supported-version-syntax - # ex: - # - 1.18beta1 -> 1.18.0-beta.1 - # - 1.18rc1 -> 1.18.0-rc.1 + fetch-depth: 0 + - uses: actions/setup-go@v5 + with: go-version: ${{ env.GO_VERSION }} - - name: Check generated files are up to date + - name: Check generated files are up-to-date run: make fast_check_generated env: # needed for github-action-config.json generation @@ -145,13 +116,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Go - uses: actions/setup-go@v5 + - uses: actions/setup-go@v5 with: - # https://github.com/actions/setup-go#supported-version-syntax - # ex: - # - 1.18beta1 -> 1.18.0-beta.1 - # - 1.18rc1 -> 1.18.0-rc.1 go-version: ${{ env.GO_VERSION }} - name: Build golangci-lint run: make build diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 9c21fa29c268..e9b17c533170 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -16,12 +16,11 @@ jobs: CHOCOLATEY_VERSION: 2.2.0 steps: - uses: actions/checkout@v4 - - name: Install Go - uses: actions/setup-go@v5 + with: + fetch-depth: 0 + - uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - - name: Unshallow - run: git fetch --prune --unshallow - name: Install chocolatey run: |