Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ci #51

Merged
merged 4 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- uses: actions/cache@v5
with:
repo-token: "${{ github.token }}"
4 changes: 3 additions & 1 deletion .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: 'site'

on:
push:
branches:
- main
paths:
- 'site/**'
- '.github/workflows/site.yml'
Expand Down Expand Up @@ -33,7 +35,7 @@ jobs:
cd site
hugo version
hugo --gc --minify
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: site
path: site/public
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/stale@v8
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is being marked as stale due to a long period of inactivity'
Expand Down
23 changes: 5 additions & 18 deletions .github/workflows/test-completions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,16 @@ env:
GO111MODULE: on

jobs:
DetermineVersion:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- id: go-version-matrix
run: |
go_version="$(awk '/^go/{print $2}' go.mod)"
echo "go_version=${go_version}.x" >> $GITHUB_OUTPUT
outputs:
go_version: ${{ steps.go-version-matrix.outputs.go_version }}

Test-Docker:
needs: DetermineVersion
runs-on: ubuntu-latest
name: Docker Tests
steps:
- name: Setup go
shell: bash
run: curl -sL https://raw.githubusercontent.com/maxatome/install-go/v3.3/install-go.pl | perl - ${{ needs.DetermineVersion.outputs.go_version }} $HOME
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
Expand Down
93 changes: 33 additions & 60 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Test

on:
push:
branches:
- main
paths:
- '**.go'
- '**.gotmpl'
Expand All @@ -20,46 +22,22 @@ env:
GO111MODULE: on

jobs:
DetermineVersion:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- id: go-version-matrix
run: |
go_version="$(awk '/^go/{print $2}' go.mod)"
echo "go_version=${go_version}.x" >> $GITHUB_OUTPUT

matrix_versions="$(git ls-remote --tags https://github.com/golang/go |
awk -F/ '$3 ~ /^go([0-9]+(\.[0-9]+)$)/{gsub(/^go/, "", $3); print $3}' |
sort -V |
sed -ne "/^$go_version$/,$ p" |
jq -cMnR '[inputs | select(length>0)] | map(. + ".x") + ["tip"]')"
echo "matrix=$matrix_versions" >> $GITHUB_OUTPUT

golangci_version="$(yq '.repos[] | select(.repo | contains("golangci-lint")) | .rev' .pre-commit-config.yaml)"
echo "golangci_version=$golangci_version" >> $GITHUB_OUTPUT
outputs:
matrix: ${{ steps.go-version-matrix.outputs.matrix }}
go_version: ${{ steps.go-version-matrix.outputs.go_version }}
golangci_version: ${{ steps.go-version-matrix.outputs.golangci_version }}

Pre-Commit:
needs: DetermineVersion
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
- name: Setup go
run: curl -sL https://raw.githubusercontent.com/maxatome/install-go/v3.3/install-go.pl | perl - ${{ needs.DetermineVersion.outputs.go_version }} $HOME
- uses: actions/checkout@v4
- uses: actions/cache@v3
- uses: actions/setup-python@v5
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/Library/Caches/go-build
~/AppData/Local/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ needs.DetermineVersion.outputs.go_version }}-${{ hashFiles('**/go.sum') }}
key: go-${{ hashFiles('**/go.sum') }}
restore-keys: go-mod
- name: Setup mdtoc
run: go install sigs.k8s.io/mdtoc@latest
Expand All @@ -68,63 +46,58 @@ jobs:
SKIP: golangci-lint,go-build,go-unit-tests

GolangCI-Lint:
needs: DetermineVersion
runs-on: ubuntu-latest
steps:
- name: Setup go
run: curl -sL https://raw.githubusercontent.com/maxatome/install-go/v3.3/install-go.pl | perl - ${{ needs.DetermineVersion.outputs.go_version }} $HOME
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- id: versions
run: |
golangci="$(yq '.repos[] | select(.repo | contains("golangci-lint")) | .rev' .pre-commit-config.yaml)"
echo "golangci=$golangci" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/Library/Caches/go-build
~/AppData/Local/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ needs.DetermineVersion.outputs.go_version }}-${{ hashFiles('**/go.sum') }}
key: go-${{ hashFiles('**/go.sum') }}
restore-keys: go-mod
- name: Run linters
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: ${{ needs.DetermineVersion.outputs.golangci_version }}
version: ${{ steps.versions.outputs.golangci }}

Vet:
needs: DetermineVersion
runs-on: ubuntu-latest
steps:
- name: Setup go
run: curl -sL https://raw.githubusercontent.com/maxatome/install-go/v3.3/install-go.pl | perl - ${{ needs.DetermineVersion.outputs.go_version }} $HOME
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/Library/Caches/go-build
~/AppData/Local/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ needs.DetermineVersion.outputs.go_version }}-${{ hashFiles('**/go.sum') }}
key: go-${{ hashFiles('**/go.sum') }}
restore-keys: go-mod
- name: Run vet
run: go vet

Test:
needs: DetermineVersion
strategy:
fail-fast: false
matrix:
go: ${{ fromJson(needs.DetermineVersion.outputs.matrix) }}
os: [ ubuntu-latest, macOS-latest, windows-latest ]
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} Go ${{ matrix.go }} Tests
runs-on: ubuntu-latest
name: Go Tests
steps:
- name: Setup go
shell: bash
run: curl -sL https://raw.githubusercontent.com/maxatome/install-go/v3.3/install-go.pl | perl - ${{ matrix.go }} $HOME
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
Expand Down
Loading
Loading