53 lines
1.3 KiB
YAML
53 lines
1.3 KiB
YAML
name: pull request validation
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- develop
|
|
|
|
jobs:
|
|
build:
|
|
name: build and run tests
|
|
env:
|
|
RUNNER_TOOL_CACHE: /toolcache
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@v4
|
|
- name: setup go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
- name: setup dependencies
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
|
|
|
- name: get fyne
|
|
run: |
|
|
go get fyne.io/fyne/v2@latest
|
|
go install fyne.io/fyne/v2/cmd/fyne@latest
|
|
|
|
- name: go mod
|
|
run: go mod tidy
|
|
|
|
- name: build
|
|
run: |
|
|
GOOS=linux
|
|
GOARCH=amd64
|
|
GOFLAGS="-ldflags=-s -ldflags=-w"
|
|
CGO_ENABLED=1
|
|
CC=gcc
|
|
fyne package --exe bin/swiped-mod-switcher-${VERSION}.${BUILD}-linux-amd64 main.go
|
|
- name: run tests
|
|
run: go test -v ./...
|
|
- name: Check Vet
|
|
run: go vet ./...
|
|
- name: check formatting
|
|
run: |-
|
|
gofmt -s -l .
|
|
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
|
|
- name: check lint
|
|
uses: golangci/golangci-lint-action@v3
|
|
with:
|
|
version: latest |