Skip to content

Commit 05705f3

Browse files
authored
adds a go test runner for remote callers (#35)
2 parents b7fba98 + dc9d51e commit 05705f3

2 files changed

Lines changed: 56 additions & 28 deletions

File tree

.github/workflows/lint.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/verify.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
ref:
5+
required: true
6+
type: string
7+
run_tests:
8+
required: false
9+
type: boolean
10+
default: true
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout caller repo
16+
uses: actions/checkout@v5
17+
with:
18+
path: _caller
19+
repository: ${{ github.event.repository.full_name }}
20+
fetch-depth: 0
21+
ref: ${{ inputs.ref }}
22+
- name: Install Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version-file: _caller/go.mod
26+
- name: Run linters
27+
uses: golangci/golangci-lint-action@v8
28+
with:
29+
version: latest
30+
args: --timeout=3m
31+
working-directory: _caller
32+
test:
33+
if: inputs.run_tests == true
34+
strategy:
35+
matrix:
36+
platform: [ubuntu-latest]
37+
runs-on: ${{ matrix.platform }}
38+
steps:
39+
- name: Checkout caller repo
40+
uses: actions/checkout@v5
41+
with:
42+
repository: ${{ github.event.repository.full_name }}
43+
fetch-depth: 0
44+
ref: ${{ inputs.ref }}
45+
- name: Install Go
46+
uses: actions/setup-go@v5
47+
with:
48+
go-version-file: go.mod
49+
- name: go tests
50+
run: go test -v -covermode=count -json ./... | tee test.json
51+
- name: annotate go tests
52+
if: always()
53+
uses: guyarb/golang-test-annotations@v0.8.0
54+
with:
55+
test-results: test.json
56+

0 commit comments

Comments
 (0)