Skip to content

Commit

Permalink
Merge pull request #75 from adrg/update-github-actions
Browse files Browse the repository at this point in the history
Update GitHub actions
  • Loading branch information
adrg authored Mar 18, 2024
2 parents 28abc3a + 0fc15b6 commit 35951a4
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 54 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
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, macos-latest, windows-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/golangci-lint-action@v4.0.0
with:
version: "v1.54"
args: --timeout=5m
23 changes: 7 additions & 16 deletions .github/workflows/ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
name: CI
name: Test

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
build:
test:
strategy:
matrix:
go: ['1.17']
go: ['1.21']
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -24,18 +27,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Dependencies
run: |
go version
go get -v -t -d ./...
go get -u golang.org/x/lint/golint
- name: Lint
run: golint -set_exit_status=1 ./...

- name: Vet
run: go vet ./...

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

Expand Down

0 comments on commit 35951a4

Please sign in to comment.