forked from endless-sky/endless-sky
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (73 loc) · 3.09 KB
/
steam.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
name: Steam
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
changed:
uses: ./.github/workflows/compute-changes.yml
build_linux:
name: Linux
needs: changed
if: ${{ needs.changed.outputs.game_code == 'true' || needs.changed.outputs.unit_tests == 'true' || needs.changed.outputs.integration_tests == 'true' || needs.changed.outputs.cmake_files == 'true' }}
runs-on: ubuntu-22.04
strategy:
matrix:
arch: [x64, x86]
env:
snapshot: latest-container-runtime-depot
runtime: steam-container-runtime.tar.gz
platform: com.valvesoftware.SteamRuntime.Platform-amd64,i386-sniper-runtime.tar.gz
steps:
- uses: actions/checkout@v4
with:
show-progress: false
# Build the binary
- name: Save Steam runtime version
id: steamrt-version
run: |
STEAM_VERSION=$(curl -sSf https://repo.steampowered.com/steamrt-images-sniper/snapshots/latest-container-runtime-depot/VERSION.txt --output -)
echo "RT_VERSION=$STEAM_VERSION" >> $GITHUB_ENV
- name: Build Endless Sky
run: |
cd steam
docker-compose run steam-${{ matrix.arch }}
# Test the binary
- name: Install runtime dependencies
run: |
sudo rm /etc/apt/sources.list.d/* && sudo dpkg --clear-avail # Speed up installation and get rid of unwanted lists
sudo apt-get update
sudo apt-get install -y --no-install-recommends libosmesa6 mesa-utils
- name: Restore cached Steam Runtime environment
id: cache-runtime
uses: actions/cache@v3
with:
path: |
${{ env.runtime }}
${{ env.platform }}
key: steamrt-${{ env.RT_VERSION }}
- name: Download Steam Runtime environment
if: steps.cache-runtime.outputs.cache-hit != 'true'
run: |
curl -sSf https://repo.steampowered.com/steamrt-images-sniper/snapshots/${{ env.snapshot }}/${{ env.runtime }} > ${{ env.runtime }}
curl -sSf https://repo.steampowered.com/steamrt-images-sniper/snapshots/${{ env.snapshot }}/${{ env.platform }} > ${{ env.platform }}
- name: Extract Steam Runtime
run: |
tar -xf ${{ env.runtime }}
tar -xf ${{ env.platform }} -C steam-container-runtime/depot/sniper_platform_*/
- name: Verify executable
run: ./steam-container-runtime/depot/run-in-sniper ./build/steam-${{ matrix.arch }}/endless-sky -- -v
- name: Execute data parsing test
run: ./steam-container-runtime/depot/run-in-sniper ./utils/test_parse.sh -- ./build/steam-${{ matrix.arch }}/endless-sky
- name: Execute integration data parsing test
run: ./steam-container-runtime/depot/run-in-sniper ./utils/test_parse.sh -- ./build/steam-${{ matrix.arch }}/endless-sky tests/integration/config
- name: Execute tests
run: |
cd steam
docker-compose run test-steam-${{ matrix.arch }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: binary-steam-${{ matrix.arch }}
path: build/steam-${{ matrix.arch }}/endless-sky