Skip to content

Commit

Permalink
chore: update GitHub Actions workflows for Go and CodeQL
Browse files Browse the repository at this point in the history
- Change the cron schedule from `'30 1 * * 0'` to `"30 1 * * 0"` in `.github/workflows/codeql.yaml`
- Change the value of `language` from `['go']` to `["go"]` in `.github/workflows/codeql.yaml`
- Update the `uses` value from `actions/checkout@v3` to `actions/checkout@v4` in `.github/workflows/codeql.yaml`
- Update the `uses` value from `actions/setup-go@v3` to `actions/setup-go@v4` in `.github/workflows/go.yml`
- Change the value of `go-version` from `'1'` to `"^1"` in `.github/workflows/go.yml`
- Update the `uses` value from `actions/checkout@v3` to `actions/checkout@v4` in `.github/workflows/go.yml`
- Add a new job in `.github/workflows/go.yml`
- Change the value of `go` from `[1.17, 1.18, 1.19]` to `[1.18, 1.19, "1.20", 1.21]` in `.github/workflows/go.yml`
- Update the `uses` value from `actions/setup-go@v3` to `actions/setup-go@v4` in `.github/workflows/go.yml`
- Update the `uses` value from

Signed-off-by: Bo-Yi Wu <[email protected]>
  • Loading branch information
appleboy committed Dec 5, 2023
1 parent 71f87e4 commit 512db63
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ name: "CodeQL"

on:
push:
branches: [ main ]
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
branches: [main]
schedule:
- cron: '30 1 * * 0'
- cron: "30 1 * * 0"

jobs:
analyze:
Expand All @@ -33,11 +33,11 @@ jobs:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
# TODO: Enable for javascript later
language: [ 'go']
language: ["go"]

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: '^1'
go-version: "^1"
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.50.1
args: --verbose

# Label of the container job
test:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.17, 1.18, 1.19]
go: [1.18, 1.19, "1.20", 1.21]
include:
- os: ubuntu-latest
go-build: ~/.cache/go-build
Expand All @@ -39,12 +38,12 @@ jobs:
slave1-port: 6380

- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}

- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Goreleaser
on:
push:
tags:
- '*'
- "*"

permissions:
contents: write
Expand All @@ -12,19 +12,16 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.17
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
go-version: "^1"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
Expand Down

0 comments on commit 512db63

Please sign in to comment.