Skip to content

Commit

Permalink
Add tests workflow & dependencies on lint & test
Browse files Browse the repository at this point in the history
  • Loading branch information
LoyalPotato committed Dec 22, 2023
1 parent a9cd2ef commit 90a5fa2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@ permissions:
# pull-requests: read

jobs:
tests:
uses: ./.github/workflows/tests.yml
golangci:
name: lint
needs: [tests]
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version-file: go.mod
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ permissions:
# packages: write

jobs:
lint:
uses: ./.github/workflows/golangci-lint.yaml
tests:
needs: [lint]
uses: ./.github/workflows/tests.yml
goreleaser:
needs: [tests]
runs-on: ubuntu-latest
steps:
-
Expand All @@ -24,7 +30,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: stable
go-version-file: go.mod
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
Expand All @@ -33,4 +39,4 @@ jobs:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: tests

on:
workflow_call:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- run: make unit-tests

0 comments on commit 90a5fa2

Please sign in to comment.