Skip to content

Commit ac3b72f

Browse files
authored
Merge pull request #681 from justinsb/remove_logic_from_gha
Chore: refactor logic out of GHA
2 parents 5be641f + c92a291 commit ac3b72f

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

.github/workflows/unit-tests.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ on:
66
- "**.go"
77
- go.mod
88
- go.sum
9+
- scripts/ci/**
910
pull_request:
1011
branches: [ main ]
1112
paths:
1213
- "**.go"
1314
- go.mod
1415
- go.sum
16+
- scripts/ci/**
1517

1618
jobs:
1719
build:
@@ -27,8 +29,5 @@ jobs:
2729
with:
2830
go-version: ${{ matrix.go-version }}
2931

30-
- name: Build
31-
run: go build cmd
32-
33-
- name: Run unit tests
34-
run: make test WHAT=unit
32+
- name: Run scripts/ci/presubmits/unit-tests
33+
run: scripts/ci/presubmits/unit-tests

scripts/ci/presubmits/unit-tests

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -o errexit
4+
set -o nounset
5+
set -o pipefail
6+
7+
REPO_ROOT="$(git rev-parse --show-toplevel)"
8+
cd ${REPO_ROOT}
9+
10+
# Build
11+
go build cmd
12+
13+
# Run unit tests
14+
make test WHAT=unit

0 commit comments

Comments
 (0)