ficsit-cli-flake/.github/workflows/push.yaml
2022-05-02 23:07:15 +03:00

81 lines
2.1 KiB
YAML

name: push
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Download GQL schema
run: "npx graphqurl https://api.ficsit.app/v2/query --introspect -H 'content-type: application/json' > schema.graphql"
- name: Go Generate
run: go generate -tags tools -x ./...
- name: Build
run: go build -v -o ficsit-cli .
env:
CGO_ENABLED: 1
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Download GQL schema
run: "npx graphqurl https://api.ficsit.app/v2/query --introspect -H 'content-type: application/json' > schema.graphql"
- name: Go Generate
run: go generate -tags tools -x ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
skip-pkg-cache: true
skip-build-cache: true
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Setup steamcmd
uses: CyberAndrii/setup-steamcmd@v1
- name: Install Satisfactory Dedicated Server
run: steamcmd +login anonymous +force_install_dir $GITHUB_WORKSPACE/SatisfactoryDedicatedServer +app_update 1690800 validate +quit && ls -lR
- name: Download GQL schema
run: "npx graphqurl https://api.ficsit.app/v2/query --introspect -H 'content-type: application/json' > schema.graphql"
- name: Go Generate
run: go generate -tags tools -x ./...
- name: Test
run: go test ./...
env:
SF_DEDICATED_SERVER: $GITHUB_WORKSPACE/SatisfactoryDedicatedServer