I went to the golang topic of GitHub sorted by "Recently updated" and looked at repositories that do not yet have a lot of stars. Most likely they are at an early stage so it might be easier to contribute simple things, such as tests and GitHub Action configurations.
I found xhash package.
As this is the first time I am adding GitHub Actions to a project written in Go I got a bit luck as this one had a Dockerfile and a Makefile. Thus it was quite obvious how to run the tests.
make
make test
I also looked at a more popular Golang project to see what they have and based on that I got the following config file that I saved as .github/workflows/ci.yml. Besides a small typo I got it right and now the CI runs and tests the code on 6 different platforms.
name: CI
on:
push:
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
runner: [ubuntu-latest, macos-latest, windows-latest]
go: [ '1.18', '1.19' ]
runs-on: ${{matrix.runner}}
name: OS ${{matrix.runner}} Go ${{matrix.go}}
steps:
- uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
check-latest: true
- name: Show Go Version and environment
run: |
go version
go env
- name: Install dependencies
run: |
make
- name: Run tests
run: |
make test