Skip to content

Commit

Permalink
ci: refactor CI/CD workflows and dependencies
Browse files Browse the repository at this point in the history
- Change cron job schedule quotes from single to double in codeql.yml
- Update CodeQL action version from v2 to v3 in codeql.yml
- Update Go version pattern from '^1.16' to '^1' in go.yml
- Restrict Go versions to 1.18, 1.19, "1.20", 1.21, 1.22 in go.yml
- Upgrade codecov-action from v3 to v4 in go.yml

Signed-off-by: appleboy <[email protected]>
  • Loading branch information
appleboy committed Feb 12, 2024
1 parent 9336054 commit ceb19a9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: '^1.16'
go-version: "^1"
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup golangci-lint
Expand All @@ -26,7 +26,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.14, 1.15, 1.16, 1.17, 1.18, 1.19, '1.20']
go: [1.18, 1.19, "1.20", 1.21, 1.22]
include:
- os: ubuntu-latest
go-build: ~/.cache/go-build
Expand Down Expand Up @@ -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 }}

0 comments on commit ceb19a9

Please sign in to comment.