Skip to content

feat: TASK-02 GitHub Actions CI #6

feat: TASK-02 GitHub Actions CI

feat: TASK-02 GitHub Actions CI #6

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GOWORK: off
jobs:
lint-and-test:
name: Lint, Vet, Unit Tests, Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| sh -s -- -b $(go env GOPATH)/bin
- name: go vet
run: go vet ./...
- name: golangci-lint
run: golangci-lint run ./...
- name: Unit tests
run: go test -race -count=1 ./...
- name: Build
run: go build ./...
integration-test:
name: Integration Tests
runs-on: ubuntu-latest
needs: lint-and-test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Setup Testcontainers Cloud Client
uses: atomicjar/testcontainers-cloud-setup-action@v1
with:
token: ${{ secrets.TC_CLOUD_TOKEN }}
- name: Integration tests
run: go test -race -tags integration -count=1 -timeout 300s ./...