Skip to content

Commit ddb1efc

Browse files
author
MalteHerrmann
committed
add CI and makefile for unit tests
1 parent 01e956b commit ddb1efc

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

.github/workflows/test.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Tests
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
- release/**
8+
9+
jobs:
10+
cleanup-runs:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: rokroskar/workflow-run-cleanup-action@master
14+
env:
15+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
16+
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"
17+
18+
test-unit:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/setup-go@v4
22+
with:
23+
go-version: '1.20'
24+
check-latest: true
25+
- uses: actions/checkout@v3
26+
- uses: technote-space/[email protected]
27+
with:
28+
PATTERNS: |
29+
**/**.go
30+
go.mod
31+
go.sum
32+
- name: Run Unit Tests
33+
run: |
34+
make test-unit
35+
if: env.GIT_DIFF

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ Ref: https://keepachangelog.com/en/1.0.0/
3535

3636
# Changelog
3737

38+
## Unreleased
39+
40+
### Improvements
41+
42+
- [#4](https://github.com/MalteHerrmann/upgrade-local-node-go/pull/4) add GH actions and Makefile for testing
43+
3844
## [v0.2.0](https://github.com/MalteHerrmann/upgrade-local-node-go/releases/tag/v0.2.0) - 2023-08-09
3945

4046
### Improvements

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
test: test-unit
2+
3+
test-unit:
4+
go test -mod=readonly ./...

0 commit comments

Comments
 (0)