-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.31 KB
/
go.yml
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
name: Go
env:
GOPRIVATE: "github.com/carted"
on:
workflow_call:
secrets:
token:
description: "The GitHub token to use for the workflow."
required: true
inputs:
go-version:
description: "The Go version to use for the build."
required: false
type: string
default: 1.19
github-username:
description: "The GitHub username to use for the build."
required: false
type: string
default: "cartedbot"
jobs:
build:
runs-on: [ self-hosted, linux ]
steps:
- name: Cleanup
run: |
cd ~
rm -rf .gitconfig
- name: Git
uses: actions/checkout@v3
- name: Go modules cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: GO
uses: actions/setup-go@v3
with:
go-version: ${{ inputs.go-version }}
- name: Private GitHub repos
run: git config --global url."https://${{ inputs.github-username }}:${{ secrets.token }}@github.com/carted".insteadOf "https://github.com/carted"
- name: Tests
run: go test -v ./...
- name: Test the build
run: go build -v ./...