-
Notifications
You must be signed in to change notification settings - Fork 1
166 lines (165 loc) · 6.33 KB
/
build_and_test.yml
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# DO NOT TEST YOURSELF
# MIGHT ONLY WORK IN A VERY CONTROLLED ENVIRONMENT AS OF NOW
# only running this in a very small windows VM
name: "Build, test, bundle FastGH3"
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_call:
workflow_dispatch:
jobs:
build:
runs-on: self-hosted
env:
#NETPACKER: ${{vars.NETPACKER}} # mpress or DotNetCompressor
#cygenv:
# ${{vars.CYGENV == 'CYGWIN' && 'cygwin' || 'msys2'}}
# # value can be either CYGWIN or MSYS
node: ${{vars.BUN == 'true' && 'bun' || 'nodejs'}}
# use Bun if true, Node.js if false
BUILD: ${{vars.BUILD}} # bitflags to indicate which types of builds to create
#NSIS: 'C:\Program Files (x86)\NSIS\makensis.exe'
#CYGWIN: winsymlinks:nativestrict
environment: Test env
if: github.actor == 'donnaken15'
steps:
-
name: Update system environment
run: |
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
-
name: Install Git
run: |
where.exe git /q; if (-not $?) {
choco install git -y
}
"C:\Program Files\Git\bin\" | Out-File -FilePath $env:GITHUB_PATH -Append
"C:\Program Files\Git\usr\" | Out-File -FilePath $env:GITHUB_PATH -Append
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x86\" | Out-File -FilePath $env:GITHUB_PATH -Append
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
pushd "C:\Program Files\Git"
compact /c /f /s /a /i /exe:lzx *.exe *.dll *.txt *.pm *. | Select-Object -Last 3
popd
-
name: Install Node.js or Bun
run: |
where.exe $env:node /q; if (-not $?) {
choco install $env:node -y --no-progress
} else { "Node environment is already installed" }
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
-
name: Install UPX, NSIS, 7Zip, Resource Hacker # make optionally installable if user decides so
run: |
choco install upx nsis 7zip resourcehacker.portable -y --no-progress
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
-
name: Install DotNetCompressor
env:
condition: ${{vars.NETPACKERS}}
if: ${{env.condition == 'DotNetCompressor'}}
run: |
iwr -Uri "https://github.com/donnaken15/DotNetCompressor/releases/latest/download/NetCompressor.exe" -OutFile "C:\Windows\DotNetCompressor.exe"
-
name: Install mpress
env:
condition: ${{vars.NETPACKERS}}
if: ${{env.condition != 'DotNetCompressor'}}
#if: ${{vars.NETPACKER == 'mpress'}}
run: |
choco install mpress -y --no-progress
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
-
name: Install stripreloc
env:
condition: ${{vars.NORELOC}}
if: ${{env.condition == 'true'}}
run: |
iwr -Uri "https://jrsoftware.org/download.php/striprlc.zip" -OutFile "striprlc.zip"
Expand-Archive -Path "striprlc.zip" -DestinationPath "C:\Windows" -Force
del "striprlc.zip"
-
name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
# manual checkout all repositories: *
# for manual testing:
# set "PATH=%PATH%;C:\Program Files\git\bin;C:\Program Files\git\usr\bin"
# & "C:\Program Files\Git\bin\git" submodule update --init --recursive --remote
# & "C:\Program Files\Git\bin\git" pull --recurse-submodules
-
name: Set up MSBuild, Visual C# and C++
env:
GH3PLUS: ${{vars.GH3PLUS}} # build GH3+ plugins
condition: ${{vars.SHARPDEV}}
if: ${{env.condition != null}}
#uses: microsoft/setup-msbuild@v1 # NOT WORKING!!
#with:
# vs-version: 'latest'
run: |
.\.github\workflows\visualDeps.ps1
#choco install microsoft-build-tools netfx-4.6.2-devpack visualcpp-build-tools -y
# NOPE: visualcpp-build-tools
# NOPE: VisualCppBuildTools
# vcbuildtools
# microsoft-visual-cpp-build-tools
#what a freaking useless "utility"
# https://download.microsoft.com/download/5/f/7/5f7acaeb-8363-451f-9425-68a90f98b238/visualcppbuildtools_full.exe
# https://download.microsoft.com/download/5/A/8/5A8B8314-CA70-4225-9AF0-9E957C9771F7/vs_BuildTools.exe
# https://aka.ms/vs/17/release/vs_BuildTools.exe
# vs_BuildTools.exe --add Microsoft.VisualStudio.Component.VC.140
-
name: Build project
env:
conf: ${{vars.GH3PLUS == true && 'Release' || 'NoVC++'}}
STUPID: true # STRIPRELOC BREAKS EXE ON SELF HOSTED RUNNER SOMEHOW
GH3PLUS: ${{vars.GH3PLUS}}
#NORELOC: ${{vars.NORELOC}} # BREAKS EXE ON VM
#RCASSETS: ${{vars.RCASSETS}} # recompile assets, NOT WORKING RIGHT NOW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
VCTargetsPath: C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140
# *
run: |
& "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" SOURCE\FastGH3.sln /p:Configuration=$env:CONF /p:WindowsTargetPlatformVersion=10.0.18362.0 /p:PlatformToolset=v140 /p:AdditionalIncludePaths="$env:INCLUDE" /t:Rebuild
#if ($env:RCASSETS) {
# cmd.exe /c "SOURCE\build-assets.bat"
#}
# ERRORS AT 'DO' IN FOR BLOCK IN CMD WTF, BROKEN POS!!!
test:
runs-on: self-hosted
env:
EXTRACFG: ${{vars.EXTRACFG}} # custom INI properties
environment: Playtest env
steps:
#-
# name: Checkout repository
# uses: actions/checkout@v2
# with:
# submodules: recursive
# directx 9 only
# https://archive.org/download/directx_9c/directx_9c_redist.exe
# http://software.oldversion.com/download.php?f=YTo1OntzOjQ6InRpbWUiO2k6MTcyNTg5MzYyOTtzOjI6ImlkIjtpOjE4NTU1O3M6NDoiZmlsZSI7czozNDoiZGlyZWN0eC05LTBjLWRpcmVjdHhfOWNfcmVkaXN0LmV4ZSI7czozOiJ1cmwiO3M6NDY6Imh0dHA6Ly93d3cub2xkdmVyc2lvbi5jb20vd2luZG93cy9kaXJlY3R4LTktMGMiO3M6NDoicGFzcyI7czozMjoiMmNmOGE1YzIzNTc5ZjEwYzUyM2Q4ZjI0NDFiZTZjZjAiO30%3D
# june 2010 https://download.microsoft.com/download/8/4/A/84A35BF1-DAFE-4AE8-82AF-AD2AE20B6B14/directx_Jun2010_redist.exe
-
name: Playtest songs
run: |
$DXTEMP = "C:\DXTEMP"
if (Test-Path -Path $DXTEMP) {
rm "$DXTEMP" -r -force
}
iwr -OutFile "DX9.EXE" -Uri "https://archive.org/download/directx_9c/directx_9c_redist.exe"
start -Wait -FilePath "DX9.EXE" -Args "/Q /T:$DXTEMP"
start -Wait -FilePath "$DXTEMP\DXSETUP.EXE" -Args "/silent"
rm "$DXTEMP" -r -force
cmd /c dir
cmd /c register.bat
.\.github\workflows\testSongs.ps1
# TODO: write configs to test
# TODO: CHECK IF BUILD TOOLS ARE INSTALLED
# TODO: should be made more cleanly by putting songs to test in this YAML
# TODO: fix game
# TODO: get a life
# i hate powershell now