go-teeworlds-protocol/.github/workflows/main.yml

88 lines
1.7 KiB
YAML

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.22'
- name: Build
run: go build -v ./...
build-readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Build go snippets in readme
run: |
mkdir -p ~/.local/bin/
wget -O ~/.local/bin/lintdown.sh https://raw.githubusercontent.com/ChillerDragon/lintdown.sh/master/lintdown.sh
chmod +x ~/.local/bin/lintdown.sh
lintdown.sh README.md
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Test
run: go test -v ./...
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Format
run: diff -u <(echo -n) <(gofmt -d ./)
teeworlds:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check game messages
run: |
if errors="$(grep -FA1 'System()' $(grep MsgGame -lr messages7/) | grep "return true")"
then
printf '%s\n' "$errors"
exit 1
fi
- name: Check system messages
run: |
if errors="$(grep -FA1 'System()' $(grep MsgSys -lr messages7/) | grep "return false")"
then
printf '%s\n' "$errors"
exit 1
fi