.github/workflows/go.yml
name: Go
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Install libraries
run: sudo apt-get install -y xorg-dev
- name: Test
run: go test -v ./...
- name: Create coverprofile
run: go test -coverprofile=unit.coverage.out github.com/andygeiss/ecs/...
- name: Get Codacy script
run: curl -o get.sh -Ls https://coverage.codacy.com/get.sh
- name: Upload to Codacy
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: bash get.sh report --force-coverage-parser go -r unit.coverage.out