summaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
blob: 0e8a5a6b287c5691f1f05597138ca5f577410701 (plain)
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
# Copyright (c) 2023 Nicolas Paul All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

name: CI
on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
jobs:
  go:
    name: Golang CI
    runs-on: ${{ matrix.os }}
    timeout-minutes: 5
    strategy:
      fail-fast: true
      matrix:
        os:
          - ubuntu-22.04
          - macos-12
        go_version:
          - "1.19"
    steps:
      - uses: actions/checkout@v3
        name: Cloning repository
      - uses: actions/setup-go@v4
        name: Installing Go ${{ matrix.go_version }}
        with:
          go-version: ${{ matrix.go_version }}
      - name: Building project
        run: go build -race -v -o=staticgovanityurls .
      - name: Testing project
        run: go test
      - name: Downloading goimports
        run: go install golang.org/x/tools/cmd/goimports@latest
      - name: Formatting project
        run: goimports -e -d -l .
  # TODO: doc: