-
Notifications
You must be signed in to change notification settings - Fork 3
110 lines (96 loc) · 4.04 KB
/
build.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
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
container: nimlang/nim
steps:
# Some of the apt dependencies require input from the installer. This disables those
# prompts so we can do a headless install
- name: Force non-interactive apt installations
run: echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
- name: Update dependencies
run: apt-get update
- name: Install dependencies
run: apt-get install -y libpng16-16 gcc-arm-none-eabi
- uses: actions/checkout@v1
- name: Download playdate SDK
run: wget https://download.panic.com/playdate_sdk/Linux/PlaydateSDK-latest.tar.gz
- name: Extract playdate SDK
run: tar -xvzf PlaydateSDK-latest.tar.gz
- name: Local publish playdate
run: nimble develop
- name: Tests
run: |
export PLAYDATE_SDK_PATH=$(readlink -f $(find PlaydateSDK-* -maxdepth 0 -type d));
nimble test;
- name: Setup
run: |
export PLAYDATE_SDK_PATH=$(readlink -f $(find PlaydateSDK-* -maxdepth 0 -type d));
cd playdate_example;
nimble setup;
- name: Install dependencies
working-directory: ./playdate_example
run: nimble install --depsOnly --accept
- name: Simulator
working-directory: ./playdate_example
run: nimble simulator
- name: Device
working-directory: ./playdate_example
run: nimble device
simulate:
runs-on: ubuntu-latest
timeout-minutes: 5
container: nimlang/nim
env:
HOME: /config
steps:
# Some of the apt dependencies require input from the installer. This disables those
# prompts so we can do a headless install
- name: Force non-interactive apt installations
run: echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
- name: Update dependencies
run: apt-get update
- name: Install dependencies
run: apt-get install -y libpng16-16 gcc-arm-none-eabi xvfb libgtk-3-0 sudo libwebkit2gtk-4.0 libwebkit2gtk-4.0-dev libsdl2-dev pulseaudio
# Because we are headless there is no audio driver to interact with by default, which causes a set
# of warnings to be emitted. This set of commands sets up a dummy audio sink that silences those warnings.
- name: Setup audio sink
run: |
pulseaudio -D --exit-idle-time=-1
pactl load-module module-null-sink sink_name=SpeakerOutput sink_properties=device.description="Dummy_Output"
- name: Checkout commit
uses: actions/checkout@v1
- name: Download playdate SDK
run: wget https://download.panic.com/playdate_sdk/Linux/PlaydateSDK-latest.tar.gz
- name: Extract playdate SDK
run: tar -xvzf PlaydateSDK-latest.tar.gz
- name: Local publish playdate
run: nimble develop
- name: Install dependencies
working-directory: ./tests
run: nimble install --depsOnly --accept
# The tests need to be told where the SDK is. Running `setup` with the SDK path configured
# will fill that in
- name: Setup tests
run: |
export PLAYDATE_SDK_PATH=$(readlink -f $(find PlaydateSDK-* -maxdepth 0 -type d));
cd tests;
nimble setup;
- name: Compile for simulator
working-directory: ./tests
run: nimble simulator
# The first time the simulator runs, it prompts the user with an alert. Obviously, we're running headless,
# so this prevents the tests from running without closing that alert. Creating this ini file will stop that
# alert from showing in the first place
- name: Create simulator ini
run: |
export PD_INI_DIR="$HOME/.Playdate Simulator"
mkdir -p "$PD_INI_DIR"
export PD_INI_FILE="$PD_INI_DIR/Playdate Simulator.ini"
echo "ShowPerfWarning=0" > $PD_INI_FILE
echo "ShowElist=0" >> $PD_INI_FILE
echo "LastRelease=$(cat PlaydateSDK-*/VERSION.txt)" >> $PD_INI_FILE
- name: Run headless test
working-directory: ./tests
run: xvfb-run ../PlaydateSDK-*/bin/PlaydateSimulator playdate.pdx