ci: update CI workflows and dependencies

- Standardize cron syntax to use double quotes in codeql.yml
- Update CodeQL action to version 3 in codeql.yml
- Standardize Go version syntax to use double quotes in go.yml
- Update golangci-lint-action to version 4 in go.yml
- Update actions/cache to version 4 in go.yml
- Update codecov-action to version 4 in go.yml
- Standardize wildcard syntax to use double quotes in goreleaser.yml
- Remove unnecessary newlines in goreleaser.yml
- Update Go version to use semver range in goreleaser.yml

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2024-02-14 12:35:16 +08:00
parent 1ff8cd13f7
commit 670c639d75
No known key found for this signature in database
3 changed files with 27 additions and 30 deletions

View File

@ -13,12 +13,12 @@ name: "CodeQL"
on:
push:
branches: [ master ]
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [master]
schedule:
- cron: '41 23 * * 6'
- cron: "41 23 * * 6"
jobs:
analyze:
@ -32,23 +32,23 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'go' ]
language: ["go"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

View File

@ -15,18 +15,18 @@ jobs:
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: '^1.16'
go-version: "^1.16"
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
args: --verbose
test:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.14, 1.15, 1.16, 1.17, 1.18, 1.19, '1.20']
go: [1.14, 1.15, 1.16, 1.17, 1.18, 1.19, "1.20"]
include:
- os: ubuntu-latest
go-build: ~/.cache/go-build
@ -48,7 +48,7 @@ jobs:
with:
ref: ${{ github.ref }}
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
${{ matrix.go-build }}
@ -61,6 +61,6 @@ jobs:
go test -v -covermode=atomic -coverprofile=coverage.out
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
flags: ${{ matrix.os }},go-${{ matrix.go }}

View File

@ -3,7 +3,7 @@ name: Goreleaser
on:
push:
tags:
- '*'
- "*"
permissions:
contents: write
@ -12,18 +12,15 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.17
-
name: Run GoReleaser
go-version: "^1"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
# either 'goreleaser' (default) or 'goreleaser-pro'