forked from schismtracker/schismtracker
-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (127 loc) · 5.17 KB
/
Copy pathubuntu.yml
File metadata and controls
147 lines (127 loc) · 5.17 KB
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
name: Ubuntu
on:
push:
pull_request:
workflow_dispatch:
jobs:
test:
# TODO test more variants; we should be regularly testing
# - dynamic load / linked variants, for libraries
# - maybe others as well; possibly we can force-disable
# stuff like avx2 to be able to test MOAR variants
# ALSO for the test suite, we need to have a public API
# that tests whether each given backend works as it
# should (as long as it initializes fine). we should also
# have a test that does a sanity check for the C time
# library, e.g. time() -> localtime() -> mktime() should
# ALWAYS return the same value as was returned by time().
# ALSO ALSO, we need to test video blitters; in the case
# of asan it would also be nice to do a full render of
# a song (or multiple songs) to make sure we don't
# overstep any memory boundaries
strategy:
fail-fast: false
matrix:
threads: [
{ flag: '--disable-threads', name: '' },
{ flag: '--enable-threads', name: '-threaded' },
]
asan: [
# We want two builds, one with asan on and the other with it off
{ flag: '', name: '' },
{ flag: '-fsanitize=address', name: '-asan' },
]
sys: [
# TODO add more hosts
{ host: ubuntu-22.04 },
]
concurrency:
group: ${{github.ref}}-${{github.workflow}}-${{matrix.sys.host}}-${{matrix.sys.compiler}}${{matrix.threads.name}}${{matrix.asan.name}}
cancel-in-progress: true
runs-on: ${{matrix.sys.host}}
steps:
- name: 'Install dependencies'
run: |
sudo apt-get update
sudo apt-get install --fix-missing libutf8proc-dev libjack-jackd2-dev build-essential automake autoconf autoconf-archive libxxf86vm-dev libsdl2-dev libsdl1.2-dev libasound2-dev libflac-dev git libtool zip wget
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'autoreconf -i'
run: autoreconf -i
- name: 'Build Schism'
env:
THREAD_FLAG: ${{ matrix.threads.flags }}
CFLAGS: '${{ matrix.asan.flag }} -g -O2'
LDFLAGS: '${{ matrix.asan.flag }}'
run: |
mkdir -p build
cd build
../configure --with-flac --with-alsa --with-jack --enable-tests
make
cd ..
- name: 'Run test suite'
run: |
# this should fail with an error code if any of the tests fail.
cd build
./schismtrackertest
cd ..
ubuntu:
# TODO for release variants, it would be nice to link against
# either a very old glibc (backwards compatibility is a fuck)
# OR we can static link against musl libc. or we could not
# care and just build an AppImage. Not sure, but either way
# it would be better than the ./run.sh hack --paper
runs-on: ubuntu-22.04
steps:
- name: 'Install dependencies'
run: |
sudo apt-get update
sudo apt-get install --fix-missing libutf8proc-dev libjack-jackd2-dev build-essential automake autoconf autoconf-archive libxxf86vm-dev libsdl2-dev libsdl1.2-dev libasound2-dev libflac-dev git libtool zip wget
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Get date of latest commit'
id: date
run: echo "date=$(git log -n 1 --date=short --format=format:%cd | sed 's/\(....\)-\(..\)-\(..\).*/\1\2\3/')" >> $GITHUB_OUTPUT
- name: 'autoreconf -i'
run: autoreconf -i
- name: 'Build Schism binaries'
run: |
mkdir -p build
cd build
../configure --with-flac --with-alsa --with-jack
make
cd ..
- name: 'Create package'
run: |
cd build
strip -S schismtracker
cd ..
cp build/schismtracker .
cp docs/configuration.md .
cp sys/posix/schismtracker.1 .
cp /usr/lib/x86_64-linux-gnu/libutf8proc.so.2 /usr/lib/x86_64-linux-gnu/libFLAC.so.8 /usr/lib/x86_64-linux-gnu/libogg.so.0 .
cp sys/fd.org/schism.desktop .
cp icons/schism-icon-128.png .
wget https://raw.githubusercontent.com/xiph/flac/master/COPYING.Xiph
cp .github/scripts/run.sh .github/scripts/install.sh .
chmod +x run.sh
chmod +x install.sh
zip schismtracker.zip configuration.md COPYING COPYING.Xiph README.md schismtracker.1 schismtracker schism.desktop schism-icon-128.png libFLAC.so.8 libogg.so.0 libutf8proc.so.2 run.sh install.sh
- name: 'Upload artifact'
uses: actions/upload-artifact@v4
with:
name: schismtracker-${{ steps.date.outputs.date }}-linux
path: schismtracker.zip
- name: 'Create source tarball'
env:
SCHISM_VERSION: ${{ steps.date.outputs.date }}
run: |
cd build
make distcheck
make dist-gzip
mv "schismtracker-$SCHISM_VERSION.tar.gz" "../schismtracker-$SCHISM_VERSION.source.tar.gz"
- name: 'Upload source tarball'
uses: actions/upload-artifact@v4
with:
name: schismtracker-${{ steps.date.outputs.date }}.source
path: schismtracker-${{ steps.date.outputs.date }}.source.tar.gz