-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (68 loc) · 1.74 KB
/
main.yaml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: CI
on:
push:
branches:
- main
- 'scratch/**'
tags:
- 'v*'
pull_request:
jobs:
check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.go }})
strategy:
fail-fast: false
matrix:
config:
- os: ubuntu-20.04
go: 1.21.x
- os: ubuntu-latest
go: stable
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.config.go }}
- name: Unit tests
shell: bash
run: ./scripts/run-unit-tests
- name: Build bbi
shell: bash
run: |
version=$(git rev-parse 'HEAD^{tree}')
bin=$(mktemp -d)
go build -o "$bin/bbi" \
-ldflags "-X github.com/metrumresearchgroup/bbi/cmd.VERSION=$version" \
cmd/bbi/main.go
echo "$bin" >>$GITHUB_PATH
- name: Integration tests (without NONMEM)
shell: bash
run: |
bbi version
go test ./integration/nmless
release:
if: github.ref_type == 'tag'
name: Make release
needs: check
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: stable
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
workdir: cmd/bbi
env:
VERSION: ${{ github.ref_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_GORELEASER_BREWS_TOKEN: ${{ secrets.GH_GORELEASER_BREWS_TOKEN }}