Skip to content

Commit

Permalink
ci: update GitHub Actions configurations and dependencies
Browse files Browse the repository at this point in the history
- Update the cron schedule in the CodeQL workflow from `41 23 * * 6` to `"41 23 * * 6"`
- Change the language setting in the CodeQL workflow from `[ 'go' ]` to `["go"]`
- Update the CodeQL action version from `v2` to `v3` in the CodeQL workflow
- Update the golangci/golangci-lint-action version from `v3` to `v4` in the Go workflow
- Update the Go version from `1.20` to `1.18` in the `go.mod` file

Signed-off-by: appleboy <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Mar 23, 2024
1 parent 25b802b commit 934af36
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 28 deletions.
36 changes: 17 additions & 19 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,21 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support
language: ["go"]

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
19 changes: 11 additions & 8 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: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup go
uses: actions/setup-go@v5
with:
go-version: '^1.16'
- name: Checkout repository
uses: actions/checkout@v4
go-version-file: go.mod
check-latest: true
- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
version: v1.49.0
args: --verbose
test:
strategy:
matrix:
os: [ubuntu-latest]
go: [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 All @@ -49,7 +52,7 @@ jobs:
with:
ref: ${{ github.ref }}

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
${{ matrix.go-build }}
Expand All @@ -62,6 +65,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 }}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gin-contrib/pprof

go 1.20
go 1.18

require github.com/gin-gonic/gin v1.9.1

Expand Down

0 comments on commit 934af36

Please sign in to comment.