Skip to content

Commit

Permalink
Update GitHub Actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
adrg committed Mar 19, 2024
1 parent c992fc7 commit 84c2042
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 78 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Analyze

on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: "0 6 * * 1"

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

jobs:
analyze:
runs-on: ubuntu-latest

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: go
queries: security-and-quality

- name: Run CodeQL analysis
uses: github/codeql-action/analyze@v3
39 changes: 0 additions & 39 deletions .github/workflows/ci.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Lint

on:
push:
branches: [master]
pull_request:

permissions:
contents: read

jobs:
lint:
strategy:
matrix:
go: ['1.21']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Setup
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Prepare checkout
run: git config --global core.autocrlf false

- name: Checkout
uses: actions/checkout@v4

- name: Lint
uses: golangci/[email protected]
with:
version: "v1.54"
args: --timeout=5m
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test

on:
push:
branches: [master]
pull_request:

permissions:
contents: read

jobs:
test:
strategy:
matrix:
go: ['1.21']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Setup
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Prepare checkout
run: git config --global core.autocrlf false

- name: Checkout
uses: actions/checkout@v4

- name: Test
run: go test -v -coverprofile coverage.txt -covermode atomic ./...

- name: Coverage
uses: codecov/codecov-action@v3
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/adrg/strutil

go 1.14
go 1.19

require github.com/stretchr/testify v1.8.4

0 comments on commit 84c2042

Please sign in to comment.