Skip to content

Commit

Permalink
ci: update workflows (#19)
Browse files Browse the repository at this point in the history
* ci: update `workflows`
* chore: update `.gitignore`
* ci(pre-commit): add `typos` hook
  • Loading branch information
DeadNews authored May 25, 2023
1 parent 6b46c46 commit 46d7970
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Dependency Review

on: [pull_request]
on:
pull_request:

permissions:
contents: read
Expand All @@ -9,8 +10,7 @@ jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Dependency Review
uses: actions/dependency-review-action@v3
26 changes: 14 additions & 12 deletions .github/workflows/go-app.yml → .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI/CD
name: Main

on:
push:
Expand All @@ -12,20 +12,21 @@ permissions:
contents: read

jobs:
code-quality:
name: Check code quality
lint:
name: Lint code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v4

- uses: golangci/golangci-lint-action@v3
- name: Lint code
uses: golangci/golangci-lint-action@v3.4.0
with:
version: latest

check-deps:
name: Check dependencies
name: Check deps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -38,12 +39,12 @@ jobs:
- name: Run govulncheck
run: govulncheck ./...

run-tests:
name: Run tests
tests:
name: Tests
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
go: ["1.19", "1.20"]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -58,14 +59,15 @@ jobs:

- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.go == '1.20'
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v3.1.4

goreleaser:
runs-on: ubuntu-latest
name: GoReleaser
if: startsWith(github.ref, 'refs/tags/')
needs: [code-quality, run-tests, check-deps]
needs: [lint, check-deps, tests]
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -74,7 +76,7 @@ jobs:
- uses: actions/setup-go@v4

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v4.2.0
with:
version: latest
args: release --rm-dist
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,3 @@ coverage.out
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local history for vscode
.history/
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ repos:
hooks:
- id: prettier

- repo: https://github.com/crate-ci/typos
rev: v1.14.11
hooks:
- id: typos

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.0
hooks:
Expand Down

0 comments on commit 46d7970

Please sign in to comment.