added code to update sha on push to main #150
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint and test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
GO_VERSION: 1.22.3 | |
jobs: | |
detect-modules: | |
runs-on: ubuntu-latest | |
outputs: | |
modules: ${{ steps.set-modules.outputs.modules }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- id: set-modules | |
run: echo "modules=$(go list -m -json | jq -s '.' | jq -c '[.[].Dir]')" >> $GITHUB_OUTPUT | |
golangci-lint: | |
needs: detect-modules | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
modules: ${{ fromJSON(needs.detect-modules.outputs.modules) }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: "0" | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22.3" | |
cache: true | |
- name: golangci-lint ${{ matrix.modules }} | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
working-directory: ${{ matrix.modules }} | |
args: -v --timeout 5m |