-
Notifications
You must be signed in to change notification settings - Fork 10
110 lines (87 loc) · 3.07 KB
/
push.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: push
on: [push, pull_request]
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21.4
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Download GQL schema
run: "npx graphqurl https://api.ficsit.dev/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
- uses: actions/upload-artifact@v4
with:
name: cli-${{ matrix.os }}
path: ficsit-cli
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21.4
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Download GQL schema
run: "npx graphqurl https://api.ficsit.dev/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:
version: v1.55.2
skip-pkg-cache: true
skip-build-cache: true
test:
name: Test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21.4
- 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
- name: Change directory permissions
if: ${{ matrix.os == 'ubuntu-latest' }}
run: mkdir -p ${{ github.workspace }}/SatisfactoryDedicatedServer/FactoryGame/Mods && chmod -R 777 ${{ github.workspace }}/SatisfactoryDedicatedServer
- name: List directory (linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: ls -lR
- name: List directory (windows)
if: ${{ matrix.os == 'windows-latest' }}
run: tree /F
- name: Boot ftp and sftp
if: ${{ matrix.os == 'ubuntu-latest' }}
run: docker-compose -f docker-compose-test.yml up -d
- name: Download GQL schema
run: "npx graphqurl https://api.ficsit.dev/v2/query --introspect -H 'content-type: application/json' > schema.graphql"
- name: Go Generate
run: go generate -tags tools -x ./...
- name: Test
run: go test -race -v ./...
env:
SF_DEDICATED_SERVER: ${{ github.workspace }}/SatisfactoryDedicatedServer