Restructure: Split core primitives into sub-packages #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pull Request | |
on: | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pull-requests: read | |
checks: write | |
jobs: | |
golangci-lint: | |
name: golangci-lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install ebitengine dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install libasound2-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev | |
# Checkout repo | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Setup Go with caching | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
cache: 'true' | |
cache-dependency-path: ./go.sum | |
check-latest: 'true' | |
go-version-file: ./go.mod | |
- name: go mod tidy | |
run: go mod tidy | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: latest | |
govet: | |
name: go vet | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Install ebitengine dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install libasound2-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev | |
# Checkout repo | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Setup Go with caching | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
cache: 'true' | |
cache-dependency-path: ./go.sum | |
check-latest: 'true' | |
go-version-file: ./go.mod | |
- name: Run go vet | |
run: | | |
go vet ./... | |
gotest: | |
needs: [govet] | |
name: go test | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Install ebitengine dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install libasound2-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev | |
# Checkout repo | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Setup Go with caching | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
cache: 'true' | |
cache-dependency-path: ./go.sum | |
check-latest: 'true' | |
go-version-file: ./go.mod | |
# Install gotestfmt | |
- name: Set up gotestfmt | |
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest | |
# Run tests with nice formatting. Save the original log in /tmp/gotest.log | |
- name: Run tests | |
run: | | |
set -euo pipefail | |
go test -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt | |
# Annotate tests | |
- name: Annotate tests | |
if: always() | |
uses: guyarb/[email protected] | |
with: | |
test-results: /tmp/gotest.log | |
# Upload the original go test log as an artifact for later review. | |
- name: Upload test log | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: test-log | |
path: /tmp/gotest.log | |
if-no-files-found: error | |
gobuild: | |
needs: [govet, gotest] | |
name: go build | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Install ebitengine dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install libasound2-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev | |
# Checkout repo | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Setup Go with caching | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
cache: 'true' | |
cache-dependency-path: ./go.sum | |
check-latest: 'true' | |
go-version-file: ./go.mod | |
# Build | |
- name: Run tests | |
run: | | |
go build ./... |