Skip to content

Commit

Permalink
chore: clean workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Jun 26, 2024
1 parent ebba6e7 commit e8e7411
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 124 deletions.
34 changes: 9 additions & 25 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,33 @@ 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:
node-version: ${{ env.NODE_VERSION }}
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
Expand Down
33 changes: 11 additions & 22 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"
31 changes: 8 additions & 23 deletions .github/workflows/pr-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,28 @@ 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:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: docs/package-lock.json

- run: go mod download

- run: npm install --legacy-peer-deps
working-directory: ./docs

Expand Down
66 changes: 16 additions & 50 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@ 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:
# Check if there is any dirty change for go mod tidy
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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down

0 comments on commit e8e7411

Please sign in to comment.