all repos

onasty @ 004414e

a one-time notes service

onasty/.github/workflows/golang.yml(view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: golang

on:
  workflow_dispatch:
  push:
    branches: [main]
    paths: ["**.go", "go.mod", "go.sum"]
  pull_request:
    paths: ["**.go", "go.mod", "go.sum"]

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5

      - name: Set up Go
        uses: actions/setup-go@v5
        with:
          go-version-file: go.mod
          cache-dependency-path: go.mod

      - name: Build API
        run: go build -o .bin/onasty ./cmd/api/

      - name: Build mailer service
        run: go build -o .bin/mailer ./mailer/

      - name: Unit tests
        run: go test -v --short ./...

      - name: e2e tests
        run: go test -v ./e2e/

  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Read .tool-versions
        uses: marocchino/tool-versions-action@v1
        id: versions

      - name: Golangci Lint
        uses: golangci/golangci-lint-action@v8
        with:
          version: "v${{ steps.versions.outputs.golangci-lint }}"
          args: ./...