Merge pull request #32 from WillyTonkas/feature/back/auth0 #72
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: CI Workflow | |
on: | |
pull_request: | |
branches: [ "main", "dev" ] | |
push: | |
branches-ignore: [ "main" ] | |
jobs: | |
lint-and-test: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.23' | |
- name: Cache Go modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Check formatting with gofmt | |
run: | | |
echo "Checking code formatting with gofmt..." | |
unformatted=$(gofmt -l .) | |
if [ -n "$unformatted" ]; then | |
echo "The following files are not formatted:" | |
echo "$unformatted" | |
exit 1 | |
fi | |
- name: Install golangci-lint | |
run: | | |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.53.3 | |
- name: Run golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.62.2 | |
- name: Run go vet | |
run: go vet ./... | |
- name: Run tests | |
run: go test ./... -v |