Skip to content

Commit 2dae34a

Browse files
committed
Add tests
1 parent 15c67c1 commit 2dae34a

File tree

13 files changed

+1849
-22
lines changed

13 files changed

+1849
-22
lines changed

.github/workflows/codecov.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Run tests and upload coverage to Codecov
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
name: Run tests and collect coverage
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Set up Go
16+
uses: actions/setup-go@v5
17+
with:
18+
go-version: '1.24'
19+
20+
- name: Install dependencies
21+
run: go mod download
22+
23+
- name: Run tests
24+
run: go test -coverprofile=coverage.txt ./...
25+
26+
- name: Upload results to Codecov
27+
uses: codecov/codecov-action@v5
28+
with:
29+
token: ${{ secrets.CODECOV_TOKEN }}
30+
slug: maxproske/lyns-rhythm-dungeon # Only needed if repo name != GitHub context

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
*.exe
2+
lynsrd
3+
coverage.out
4+
coverage.html

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
{
2-
"go.inferGopath": true // For Ubuntu
32
}

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.PHONY: deps build run
2+
3+
deps:
4+
brew list sdl2{,_mixer,_image,_ttf} || brew install sdl2{,_mixer,_image,_ttf}
5+
go mod tidy
6+
7+
# -w -s reduces binary size by ~1.3MB
8+
build:
9+
go build -ldflags "-w -s" -o lynsrd
10+
11+
run:
12+
go run main.go

README.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Lyn's Rhythm Dungeon
22

3-
What's in a name?
3+
[![codecov](https://codecov.io/gh/maxproske/lyns-rythm-dungeon/branch/master/graph/badge.svg)](https://codecov.io/gh/maxproske/lyns-rythm-dungeon)
44

55
## Why Go?
66

@@ -9,17 +9,10 @@ What's in a name?
99
- Garbage collection is very low latency, compared to Java or C# which focus on throughput.
1010
- First-class support for concurrency, memory allocation, and unit testing.
1111

12-
## Getting Started (MacOS)
12+
## Getting Started (macOS)
1313

1414
```sh
15-
# Install Go
16-
brew install go
17-
18-
# Install SDL2
19-
brew install sdl2{,_image,_mixer,_ttf,_gfx} pkg-config
20-
go get -v github.com/veandco/go-sdl2/{sdl,img,mix,ttf}
21-
22-
# Build
23-
go build -o lynsrd
24-
./lynsrd
25-
```
15+
make deps
16+
make build
17+
make run
18+
```

build_release.sh

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

0 commit comments

Comments
 (0)