Skip to content

Merge pull request #28 from WillyTonkas/development/back/create-end-p… #63

Merge pull request #28 from WillyTonkas/development/back/create-end-p…

Merge pull request #28 from WillyTonkas/development/back/create-end-p… #63

Workflow file for this run

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