Skip to content

Commit

Permalink
ci: update CI/CD workflows and dependencies
Browse files Browse the repository at this point in the history
- Update cron syntax to use double quotes in codeql.yaml
- Update CodeQL action versions from v1 to v3 in codeql.yaml
- Replace setup-go action with checkout action and update versions in go.yml
- Add fetch-depth configuration to checkout action in go.yml
- Change setup-go action to use go.mod file for version and enable check-latest in go.yml
- Update golangci-lint action version to v4 and set version to latest in go.yml
- Update supported Go versions to 1.18 through 1.22 in go.yml
- Update cache action version to v4 in go.yml
- Update codecov action version to v4 in go.yml
- Update checkout and setup-go action versions in goreleaser.yml
- Change goreleaser-action version from v2 to v5 and update args in goreleaser.yml
- Enable skipping the build by default in .goreleaser.yaml
- Update section titles to use double quotes in .goreleaser.yaml
- Change regex patterns to use double quotes in .goreleaser.yaml

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Feb 18, 2024
1 parent 1a98052 commit 7a07f0e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 37 deletions.
12 changes: 6 additions & 6 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,15 +33,15 @@ 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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
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.
Expand All @@ -50,4 +50,4 @@ jobs:
# queries: ./path/to/local/query, your-org/your-repo/queries@main

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
27 changes: 15 additions & 12 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,25 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Setup go
uses: actions/setup-go@v2
- name: Checkout
uses: actions/checkout@v4
with:
go-version: '^1'
- name: Checkout repository
uses: actions/checkout@v3
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
check-latest: true
- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v4
with:
version: v1.45.0
version: latest
args: --verbose
test:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.13, 1.14, 1.15, 1.16, 1.17, 1.18]
go: [1.18, 1.19, "1.20", 1.21, 1.22]
include:
- os: ubuntu-latest
go-build: ~/.cache/go-build
Expand All @@ -38,16 +41,16 @@ jobs:
GOPROXY: https://proxy.golang.org
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

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

- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: |
${{ matrix.go-build }}
Expand All @@ -60,6 +63,6 @@ jobs:
go test -v -covermode=atomic -coverprofile=coverage.out ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
with:
flags: ${{ matrix.os }},go-${{ matrix.go }}
22 changes: 10 additions & 12 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,23 +12,21 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.17
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
go-version-file: "go.mod"
check-latest: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 7 additions & 7 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
project_name: queue

builds:
-
# If true, skip the build.
- # If true, skip the build.
# Useful for library projects.
# Default is false
skip: true

changelog:
# Set it to true if you wish to skip the changelog generation.
# This may result in an empty release notes on GitHub/GitLab/Gitea.
skip: false
# Default is false
skip: true

# Changelog generation implementation to use.
#
Expand Down Expand Up @@ -38,10 +38,10 @@ changelog:
- title: Features
regexp: "^.*feat[(\\w)]*:+.*$"
order: 0
- title: 'Bug fixes'
- title: "Bug fixes"
regexp: "^.*fix[(\\w)]*:+.*$"
order: 1
- title: 'Enhancements'
- title: "Enhancements"
regexp: "^.*chore[(\\w)]*:+.*$"
order: 2
- title: Others
Expand All @@ -52,6 +52,6 @@ changelog:
# the changelog
# Default is empty
exclude:
- '^docs'
- 'CICD'
- "^docs"
- "CICD"
- typo

0 comments on commit 7a07f0e

Please sign in to comment.