2022-04-14 01:35:11 +00:00
|
|
|
name: push
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build
|
2023-12-20 22:37:18 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest]
|
|
|
|
runs-on: ${{ matrix.os }}
|
2022-04-14 01:35:11 +00:00
|
|
|
steps:
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2023-12-13 23:34:01 +00:00
|
|
|
go-version: 1.21.4
|
2022-04-14 01:35:11 +00:00
|
|
|
|
|
|
|
- name: Check out code into the Go module directory
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Download GQL schema
|
2023-12-07 16:57:31 +00:00
|
|
|
run: "npx graphqurl https://api.ficsit.dev/v2/query --introspect -H 'content-type: application/json' > schema.graphql"
|
2022-04-14 01:35:11 +00:00
|
|
|
|
|
|
|
- name: Go Generate
|
|
|
|
run: go generate -tags tools -x ./...
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: go build -v -o ficsit-cli .
|
|
|
|
env:
|
|
|
|
CGO_ENABLED: 1
|
|
|
|
|
2023-12-20 22:37:18 +00:00
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: cli-${{ matrix.os }}
|
|
|
|
path: ficsit-cli
|
|
|
|
|
2022-04-14 01:35:11 +00:00
|
|
|
lint:
|
|
|
|
name: Lint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2023-12-13 23:34:01 +00:00
|
|
|
go-version: 1.21.4
|
2022-04-14 01:35:11 +00:00
|
|
|
|
|
|
|
- name: Check out code into the Go module directory
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2022-04-14 01:36:28 +00:00
|
|
|
- name: Download GQL schema
|
2023-12-07 16:57:31 +00:00
|
|
|
run: "npx graphqurl https://api.ficsit.dev/v2/query --introspect -H 'content-type: application/json' > schema.graphql"
|
2022-04-14 01:36:28 +00:00
|
|
|
|
2022-04-14 01:38:52 +00:00
|
|
|
- name: Go Generate
|
|
|
|
run: go generate -tags tools -x ./...
|
|
|
|
|
2022-04-14 01:35:11 +00:00
|
|
|
- name: golangci-lint
|
|
|
|
uses: golangci/golangci-lint-action@v2
|
|
|
|
with:
|
2023-12-13 23:34:01 +00:00
|
|
|
version: v1.55.2
|
2022-04-14 01:35:11 +00:00
|
|
|
skip-pkg-cache: true
|
|
|
|
skip-build-cache: true
|
|
|
|
|
|
|
|
test:
|
|
|
|
name: Test
|
2022-05-02 20:18:33 +00:00
|
|
|
strategy:
|
2022-05-02 20:31:23 +00:00
|
|
|
fail-fast: false
|
2022-05-02 20:18:33 +00:00
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest]
|
|
|
|
runs-on: ${{ matrix.os }}
|
2022-04-14 01:35:11 +00:00
|
|
|
steps:
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2023-12-13 23:34:01 +00:00
|
|
|
go-version: 1.21.4
|
2022-04-14 01:35:11 +00:00
|
|
|
|
|
|
|
- name: Check out code into the Go module directory
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2022-05-02 20:07:15 +00:00
|
|
|
- name: Setup steamcmd
|
|
|
|
uses: CyberAndrii/setup-steamcmd@v1
|
|
|
|
|
|
|
|
- name: Install Satisfactory Dedicated Server
|
2022-05-02 21:23:20 +00:00
|
|
|
run: steamcmd +login anonymous +force_install_dir ${{ github.workspace }}/SatisfactoryDedicatedServer +app_update 1690800 validate +quit
|
2022-05-02 20:07:15 +00:00
|
|
|
|
2023-12-28 00:13:09 +00:00
|
|
|
- name: Change directory permissions
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
|
|
run: mkdir -p ${{ github.workspace }}/SatisfactoryDedicatedServer/FactoryGame/Mods && chmod -R 777 ${{ github.workspace }}/SatisfactoryDedicatedServer
|
|
|
|
|
2022-05-02 21:07:43 +00:00
|
|
|
- name: List directory (linux)
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
|
|
run: ls -lR
|
|
|
|
|
|
|
|
- name: List directory (windows)
|
|
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
|
|
|
run: tree /F
|
|
|
|
|
2023-12-28 00:13:09 +00:00
|
|
|
- name: Boot ftp and sftp
|
|
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
2024-08-14 00:27:07 +00:00
|
|
|
run: docker compose -f docker-compose-test.yml up -d
|
2023-12-28 00:13:09 +00:00
|
|
|
|
2022-04-14 01:35:11 +00:00
|
|
|
- name: Download GQL schema
|
2023-12-07 16:57:31 +00:00
|
|
|
run: "npx graphqurl https://api.ficsit.dev/v2/query --introspect -H 'content-type: application/json' > schema.graphql"
|
2022-04-14 01:35:11 +00:00
|
|
|
|
|
|
|
- name: Go Generate
|
|
|
|
run: go generate -tags tools -x ./...
|
|
|
|
|
|
|
|
- name: Test
|
2023-12-07 21:31:37 +00:00
|
|
|
run: go test -race -v ./...
|
2022-05-02 20:07:15 +00:00
|
|
|
env:
|
2022-05-02 20:18:33 +00:00
|
|
|
SF_DEDICATED_SERVER: ${{ github.workspace }}/SatisfactoryDedicatedServer
|