-
-
Notifications
You must be signed in to change notification settings - Fork 1
166 lines (150 loc) · 5.17 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
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
156
157
158
159
160
161
162
163
164
165
166
name: Build and test
on: [push, pull_request]
jobs:
package-main:
runs-on: ubuntu-latest
name: Test package desmume-rs
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
# we don't verify, since the build is covered by other tests.
- name: Test packaging desmume-rs
run: cargo package --no-verify -p desmume-rs
package-sys:
runs-on: ubuntu-latest
name: Test package desmume-sys
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
# we don't verify, since the build is covered by other tests.
- name: Test packaging desmume-sys
run: cargo package --no-verify -p desmume-sys
tests:
runs-on: ${{ matrix.os }}
name: Test
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
target: i686-pc-windows-msvc
arch: x86
- os: windows-2019
target: x86_64-pc-windows-msvc
arch: x64
- os: macos-11
target: x86_64-apple-darwin
arch: x64
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
arch: x64
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install MacOS build deps
if: matrix.os == 'macos-11'
run: |
brew install coreutils gcc sdl2 meson glib
- name: "MacOS: Set env"
if: matrix.os == 'macos-11'
run: |
CC=gcc-10 >> $GITHUB_ENV
CXX=g++-10 >> $GITHUB_ENV
- name: Add msbuild to PATH
if: matrix.os == 'windows-2019'
uses: microsoft/setup-msbuild@v1
- name: Install meson, SDL, etc.
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install python3 python3-pip python3-setuptools python3-wheel ninja-build libsdl2-dev libsdl2-2.0-0 libpcap0.8-dev
sudo pip3 install meson
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
default: true
# I don't know why but actions-rs seems to like not ACTUALLY setting the target
- name: Set target
run: rustup default stable-${{ matrix.target }}
# With Windows we need to make sure SDL2.dll is in the PATH
- name: Add SDL2.dll to PATH
if: matrix.os == 'windows-2019'
run: echo "$PWD\desmume_sys\desmume\desmume\src\frontend\interface\windows\SDL\lib\${{ matrix.arch }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Run cargo test
run: cargo test
env:
SDL_VIDEODRIVER: dummy
TARGET: ${{ matrix.target }}
build:
runs-on: ${{ matrix.os }}
name: Build
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
target: i686-pc-windows-msvc
- os: windows-2019
target: x86_64-pc-windows-msvc
- os: macos-11
target: x86_64-apple-darwin
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install MacOS build deps
if: matrix.os == 'macos-11'
run: |
brew install coreutils gcc sdl2 meson glib
- name: "MacOS: Set env"
if: matrix.os == 'macos-11'
run: |
CC=gcc-10 >> $GITHUB_ENV
CXX=g++-10 >> $GITHUB_ENV
- name: Add msbuild to PATH
if: matrix.os == 'windows-2019'
uses: microsoft/setup-msbuild@v1
- name: Install meson, SDL, etc.
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install python3 python3-pip python3-setuptools python3-wheel ninja-build libsdl2-dev libsdl2-2.0-0 libpcap0.8-dev
sudo pip3 install meson
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
default: true
# I don't know why but actions-rs seems to like not ACTUALLY setting the target
- name: Set target
run: rustup default stable-${{ matrix.target }}
# Remove all files that the exclude statement in Cargo.toml of desmume-sys removes.
- name: Remove excluded
if: matrix.os != 'windows-2019'
run: |
rm -rf desmume_sys/desmume/desmume/src/frontend/cocoa
rm -rf desmume_sys/desmume/desmume/src/frontend/windows/File_Extractor
rm -rf desmume_sys/desmume/desmume/src/frontend/windows/directx
- name: Remove excluded
if: matrix.os == 'windows-2019'
run: |
rm -r -force desmume_sys/desmume/desmume/src/frontend/cocoa
rm -r -force desmume_sys/desmume/desmume/src/frontend/windows/File_Extractor
rm -r -force desmume_sys/desmume/desmume/src/frontend/windows/directx
- name: Build
run: cargo build -vv --release
env:
TARGET: ${{ matrix.target }}