Skip to content

Commit

Permalink
chore: update ci tools version
Browse files Browse the repository at this point in the history
  • Loading branch information
soulteary committed Jan 31, 2024
1 parent 6058125 commit 8aa25bd
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 37 deletions.
44 changes: 17 additions & 27 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,44 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
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: "41 23 * * 6"
- cron: "0 0 * * *"

env:
GO_VERSION: "1.21"

permissions:
actions: read
contents: read
security-events: write

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

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

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

# Initializes the CodeQL tools for scanning.
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- 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
uses: github/codeql-action/analyze@v3
15 changes: 10 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ name: Run Tests

on:
push:
branches:
- main
branches: ["main"]
pull_request:
branches:
- main
branches: ["main"]

env:
GO_VERSION: "1.21"

jobs:
lint:
Expand All @@ -15,13 +16,16 @@ jobs:
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: "^1.21"
go-version: ${{ env.GO_VERSION }}

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

- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: --verbose

test:
strategy:
matrix:
Expand Down Expand Up @@ -56,6 +60,7 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run Tests
run: |
go test -v -covermode=atomic -coverprofile=coverage.out
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ name: Go Releaser

on:
push:
tags:
- "*"
tags: ["*"]

env:
GO_VERSION: "1.21"

permissions:
contents: write
Expand All @@ -16,16 +18,17 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.17
go-version: ${{ env.GO_VERSION }}

- 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 }}

0 comments on commit 8aa25bd

Please sign in to comment.