forked from speccytools/fusex
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_libspectrum_macos_sub.yml
More file actions
155 lines (136 loc) · 5.31 KB
/
build_libspectrum_macos_sub.yml
File metadata and controls
155 lines (136 loc) · 5.31 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
148
149
150
151
152
153
154
155
name: Libspectrum for MacOS
run-name: Build and test Libspectrum for MacOS / ${{ github.actor }} /
on:
workflow_call:
inputs:
key:
type: string
required: true
libspectrum_ref:
type: string
required: false
default: master
use_zlib:
type: boolean
required: false
default: true
use_bzip2:
type: boolean
required: false
default: true
use_libgcrypt:
type: boolean
required: false
default: true
use_fake_glib:
type: boolean
required: false
default: false
jobs:
build:
name: Build & Test
runs-on: macos-26
timeout-minutes: 15
defaults:
run:
shell: bash
env:
LIBSPECTRUM_DIR: libspectrum
LIBSPECTRUM_GIT_URL: https://git.code.sf.net/p/fuse-emulator/libspectrum
steps:
- name: (1) Prepare environment
run: |
echo -n "Current directory: "
pwd
ls -la
echo "Libspectrum URL: $LIBSPECTRUM_GIT_URL"
echo "Libspectrum ref: ${{ inputs.libspectrum_ref }}"
echo "Use lib zlib: ${{ inputs.use_zlib && 'yes' || 'no' }}"
echo "Use lib bzip2: ${{ inputs.use_bzip2 && 'yes' || 'no' }}"
echo "Use lib libgcrypt: ${{ inputs.use_libgcrypt && 'yes' || 'no' }}"
echo "Use lib libaudiofile: no"
echo "Use fake glib: ${{ inputs.use_fake_glib && 'yes' || 'no' }}"
- name: (2) Clone libspectrum source
run: |
git init "$LIBSPECTRUM_DIR"
git -C "$LIBSPECTRUM_DIR" remote add origin "$LIBSPECTRUM_GIT_URL"
git -C "$LIBSPECTRUM_DIR" fetch --depth 1 origin "${{ inputs.libspectrum_ref }}"
git -C "$LIBSPECTRUM_DIR" checkout FETCH_HEAD
- name: (3) Install dependencies
run: |
echo "Inspect if brew installed .."
brew doctor || true
echo "Installing dependencies .."
brew install \
automake \
bzip2 \
libgcrypt \
libtool \
glib
echo "Configuring Homebrew search paths .."
echo "CPPFLAGS=-I$(brew --prefix)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix libgcrypt)/include -I$(brew --prefix glib)/include" >> "$GITHUB_ENV"
echo "LDFLAGS=-L$(brew --prefix)/lib -L$(brew --prefix bzip2)/lib -L$(brew --prefix libgcrypt)/lib -L$(brew --prefix glib)/lib" >> "$GITHUB_ENV"
echo "PKG_CONFIG_PATH=$(brew --prefix)/lib/pkgconfig:$(brew --prefix bzip2)/lib/pkgconfig:$(brew --prefix libgcrypt)/lib/pkgconfig:$(brew --prefix glib)/lib/pkgconfig" >> "$GITHUB_ENV"
- name: (4) Autogen.sh
working-directory: ${{ env.LIBSPECTRUM_DIR }}
run: |
echo "Running autogen.sh .."
./autogen.sh
- name: (5) Configure for MacOS
working-directory: ${{ env.LIBSPECTRUM_DIR }}
run: |
echo "Running configure .."
./configure \
${{ inputs.use_zlib == false && '--without-zlib' || '' }} \
${{ inputs.use_bzip2 == false && '--without-bzip2' || '' }} \
${{ inputs.use_libgcrypt == false && '--without-libgcrypt' || '' }} \
--without-libaudiofile \
${{ inputs.use_fake_glib == true && '--with-fake-glib' || '' }} \
| tee ./configure.out
- name: (6) Verify output from configure
working-directory: ${{ env.LIBSPECTRUM_DIR }}
run: |
.github/scripts/in_config.sh "libspectrum is ready to be compiled"
.github/scripts/in_config.sh "zlib support: ${{ inputs.use_zlib && 'yes' || 'no' }}"
.github/scripts/in_config.sh "bzip2 support: ${{ inputs.use_bzip2 && 'yes' || 'no' }}"
.github/scripts/in_config.sh "libgcrypt support: ${{ inputs.use_libgcrypt && 'yes' || 'no' }}"
.github/scripts/in_config.sh "libaudiofile support: no"
.github/scripts/in_config.sh "Internal GLib replacement: ${{ inputs.use_fake_glib && 'yes' || 'no' }}"
- name: (7) Make
working-directory: ${{ env.LIBSPECTRUM_DIR }}
run: |
echo "Running make .."
make
- name: (8) Install
working-directory: ${{ env.LIBSPECTRUM_DIR }}
run: |
echo "Running make install .."
sudo make install
- name: (9) Run tests
id: run-tests
working-directory: ${{ env.LIBSPECTRUM_DIR }}
run: |
echo "Building and running tests .."
make check
- name: (10) Verbose check tests (on failure)
if: failure() && steps.run-tests.outcome != 'success'
working-directory: ${{ env.LIBSPECTRUM_DIR }}
run: |
echo "Listing all tests individually .."
test/test
- name: (11) Pack installed library files
working-directory: ${{ env.LIBSPECTRUM_DIR }}
run: |
find /usr/local | grep libspectrum > .tar_files
sudo tar -cvf \
libspectrum-installed-macos.tar \
-C /usr/local/ -T.tar_files
- name: (12) Upload generated tar file
uses: actions/upload-artifact@v7
with:
name: libspectrum-installed-macos-${{ inputs.key }}
path: |
${{ env.LIBSPECTRUM_DIR }}/libspectrum-installed-macos.tar
- name: (13) Finish
run: |
echo "Finishing with status ${{ job.status }}."