-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (39 loc) · 1.15 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
name: Go
on:
push:
branches:
- master
pull_request:
env:
# renovate: datasource=golang-version depName=golang
GO_VERSION: '1.23.1'
jobs:
build:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version: '${{ env.GO_VERSION }}'
id: go
- name: Build
run: go build -v ./...
- name: Test
run: go test -v -cover ./...
- name: Test with Github API
run: |
T=$(mktemp)
trap "rm -f $T" 1 2 3 15
urlparam=""
if [ -n "${GITHUB_URL}" ]; then
urlparam="-url ${GITHUB_URL}"
fi
eval "$(./go-github-apps -export -app-id "${GH_APP_ID}" -inst-id "${GH_APP_INST_ID}")"
curl --fail -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/
env:
GH_APP_INST_ID: ${{ secrets.installation_id }}
GH_APP_ID: ${{ secrets.app_id }}
GITHUB_PRIV_KEY: ${{ secrets.private_key }}