forked from doldecomp/melee
-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (128 loc) · 3.71 KB
/
build-melee.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
name: build-melee
run-name: Build Melee
on:
push:
paths: [ "**" ]
pull_request:
env:
IMAGE_REPO: doldecomp/melee
jobs:
build-linux:
name: Linux
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
OUTPUT: ${{ github.workspace }}/output
strategy:
matrix:
make_flags: ["GENERATE_MAP=1", "NON_MATCHING=1"]
fail-fast: false
steps:
- name: Get image name
env:
IMAGE_SUFFIX: build-linux:latest
run: |
echo "IMAGE=$IMAGE_REPO/$IMAGE_SUFFIX" >> $GITHUB_ENV
- name: Checkout Melee repository
uses: actions/checkout@v3
- name: Log into container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull build image
run: docker pull "$REGISTRY/$IMAGE"
- name: Build Melee
env:
MAKE_FLAGS: ${{ matrix.make_flags }}
run: |
mkdir -p "$OUTPUT"
docker run --rm \
--user "$(id -u):$(id -g)" \
--volume "$PWD":/input:ro \
--volume "$OUTPUT:/output" \
--env MAKE_FLAGS="$MAKE_FLAGS" \
"$REGISTRY/$IMAGE"
- name: Upload map
if: matrix.make_flags == 'GENERATE_MAP=1'
uses: actions/upload-artifact@v3
with:
name: GALE01.map
path: ${{ env.OUTPUT }}/ssbm.us.1.2/GALE01.map
if-no-files-found: error
- name: Set step summary
if: matrix.make_flags == 'GENERATE_MAP=1'
run: |
printf "\`\`\`\n%s\n\`\`\`" "$(cat "$OUTPUT/PROGRESS.md")" \
>> $GITHUB_STEP_SUMMARY
build-windows:
name: Windows
runs-on: windows-latest
env:
REGISTRY: ghcr.io
MAKE_FLAGS: ${{ matrix.make_flags }}
strategy:
matrix:
make_flags: ["GENERATE_MAP=1", "NON_MATCHING=1"]
fail-fast: false
steps:
- name: Get image name
env:
IMAGE_SUFFIX: build-windows:latest
shell: bash
run: |
echo "IMAGE=$IMAGE_REPO/$IMAGE_SUFFIX" >> $GITHUB_ENV
- name: Checkout Melee repository
uses: actions/checkout@v3
- name: Log into container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull build image
shell: bash
run: docker pull "$REGISTRY/$IMAGE"
- name: Build Melee
env:
MAKE_FLAGS: ${{ matrix.make_flags }}
run: |
$output = New-Item `
-Path "$env:TEMP/Output" `
-ItemType Directory `
-Force
# the container's user needs to be able to write to the runner's dir
icacls $output /T /grant 'Everyone:(OI)(CI)(F)'
docker run --rm `
--volume "${PWD}:C:/Input:ro" `
--volume "${output}:C:/Output" `
--env MAKE_FLAGS="$env:MAKE_FLAGS" `
"$env:REGISTRY/$env:IMAGE"
check-issues:
name: Issues
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
steps:
- name: Get image name
env:
IMAGE_SUFFIX: check-issues:latest
run: |
echo "IMAGE=$IMAGE_REPO/$IMAGE_SUFFIX" >> $GITHUB_ENV
- name: Checkout Melee repository
uses: actions/checkout@v3
- name: Log into container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull build image
run: docker pull "$REGISTRY/$IMAGE"
- name: Check for code issues
run: |
docker run --rm \
--user "$(id -u):$(id -g)" \
--volume "$PWD:/input:ro" \
"$REGISTRY/$IMAGE"