forked from p7zip-project/p7zip
-
Notifications
You must be signed in to change notification settings - Fork 2
173 lines (164 loc) · 6.35 KB
/
ci.yaml
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
167
168
169
170
171
172
173
name: CI
on:
push:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-20.04
mode: "gcc-x64"
- os: ubuntu-20.04
mode: "gcc-x86"
- os: ubuntu-20.04
mode: "clang"
- os: ubuntu-20.04
mode: "android-aarch64"
- os: ubuntu-20.04
mode: "win64"
- os: ubuntu-20.04
mode: "win32"
- os: macos-latest
steps:
- uses: actions/checkout@v2
- name: Checkout submodule
run: |
git submodule init
git submodule update
- name: Set up UASM (Linux)
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: |
curl -L https://github.com/Terraspace/UASM/archive/refs/tags/v2.55.tar.gz | tar xz
make -C UASM-2.55 -f gccLinux64.mak
sudo cp UASM-2.55/GccUnixR/uasm /usr/local/bin/
- name: Set up UASM (macOS)
if: ${{ matrix.os == 'macos-latest' }}
run: |
curl -L https://github.com/Terraspace/UASM/archive/refs/tags/v2.55.tar.gz | tar xz
# Apple clang 12+ requires "-Wno-error=implicit-function-declaration" cf https://forum.mmm.ucar.edu/phpBB3/viewtopic.php?t=11087&p=24226
sed -i -e 's/-ansi/-Wno-error=implicit-function-declaration/' UASM-2.55/ClangOSX64.mak
make -C UASM-2.55 -f ClangOSX64.mak CC=clang
sudo cp UASM-2.55/GccUnixR/uasm /usr/local/bin/
# - name: Set up UASM (Win)
# if: ${{ matrix.os == 'windows-latest' }}
# shell: bash
# run: |
# curl -L https://github.com/Terraspace/UASM/archive/refs/tags/v2.55.tar.gz | tar xz
# make -C UASM-2.55 -f GccWin64.mak
# cp UASM-2.55/MinGW-w64R/hjwasm.exe C:/windows/system32/uasm.exe
- name: Build (Linux/GCC-x64)
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.mode == 'gcc-x64' }}
run: |
export CMPL=cmpl_gcc_x64
export OUTDIR=g_x64
export FLAGS=""
export CFLAGS_ADDITIONAL=""
./build_linux.sh
- name: Build (Linux/GCC-x86)
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.mode == 'gcc-x86' }}
run: |
sudo apt update
sudo apt install g++-multilib -y
echo 'gcc -m32 "$@"' | sudo tee /usr/local/bin/i686-linux-gnu-gcc
echo 'g++ -m32 "$@"' | sudo tee /usr/local/bin/i686-linux-gnu-g++
sudo chmod 755 /usr/local/bin/i686-linux-gnu-gcc /usr/local/bin/i686-linux-gnu-g++
export CMPL=cmpl_gcc_x86
export OUTDIR=g_x86
export FLAGS="CROSS_COMPILE=i686-linux-gnu-"
export CFLAGS_ADDITIONAL=""
./build_linux.sh
- name: Build (Linux/Clang)
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.mode == 'clang' }}
run: |
export CMPL=cmpl_clang_x64
export OUTDIR=c_x64
export FLAGS=""
export CFLAGS_ADDITIONAL=""
./build_linux.sh
- name: Build (Linux/android-aarch64)
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.mode == 'android-aarch64' }}
run: |
sed -i -e 's/\&\& LZHAM_PLATFORM_PC/\&\& LZHAM_PLATFORM_PC \&\& !defined(__aarch64__)/' Codecs/lzham_codec_devel/lzhamdecomp/lzham_platform.h
export TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64
export TARGET=aarch64-linux-android
export API=21
export PATH=$PATH:$TOOLCHAIN/bin
# it seems (on clang) -march=armv8-a+crypto must be specified on command line or __ARM_FEATURE_CRYPTO will not be enabled.
export CMPL=cmpl_clang_arm64
export OUTDIR=c_arm64
export FLAGS="CROSS_COMPILE=${TARGET}${API}-"
export CFLAGS_ADDITIONAL="-march=armv8-a+crypto -Wno-error"
./build_linux.sh
- name: Build (macOS)
if: ${{ matrix.os == 'macos-latest' }}
run: |
echo 'clang -arch arm64 -fno-stack-check "$@"' | sudo tee /usr/local/bin/arm64-apple-darwin-clang
echo 'clang++ -arch arm64 -fno-stack-check "$@"' | sudo tee /usr/local/bin/arm64-apple-darwin-clang++
sudo chmod 755 /usr/local/bin/arm64-apple-darwin-clang /usr/local/bin/arm64-apple-darwin-clang++
sed -i -e 's/\&\& LZHAM_PLATFORM_PC/\&\& LZHAM_PLATFORM_PC \&\& !defined(__aarch64__)/' Codecs/lzham_codec_devel/lzhamdecomp/lzham_platform.h
./build_macos.sh
- name: Build (Win64)
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.mode == 'win64' }}
shell: bash
run: |
sudo apt update
sudo apt install mingw-w64 -y
export CMPL=cmpl_gcc_x64
export OUTDIR=g_x64
export FLAGS="MSYSTEM=1 SystemDrive=1 RC=x86_64-w64-mingw32-windres CROSS_COMPILE=x86_64-w64-mingw32-"
export CFLAGS_ADDITIONAL=""
./build_win.sh
- name: Build (Win32)
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.mode == 'win32' }}
shell: bash
run: |
sudo apt update
sudo apt install mingw-w64 -y
export CMPL=cmpl_gcc_x86
export OUTDIR=g_x86
export FLAGS="MSYSTEM=1 SystemDrive=1 RC=i686-w64-mingw32-windres CROSS_COMPILE=i686-w64-mingw32-"
export CFLAGS_ADDITIONAL=""
./build_win.sh
- name: Upload (Linux/GCC-x64)
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.mode == 'gcc-x64' }}
uses: actions/upload-artifact@v2
with:
name: linux-x64
path: bin
- name: Upload (Linux/GCC-x86)
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.mode == 'gcc-x86' }}
uses: actions/upload-artifact@v2
with:
name: linux-x86
path: bin
- name: Upload (Linux/Clang)
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.mode == 'clang' }}
uses: actions/upload-artifact@v2
with:
name: linux-clang
path: bin
- name: Upload (Linux/android-aarch64)
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.mode == 'android-aarch64' }}
uses: actions/upload-artifact@v2
with:
name: android-aarch64
path: bin
- name: Upload (macOS)
if: ${{ matrix.os == 'macos-latest' }}
uses: actions/upload-artifact@v2
with:
name: macos
path: bin
- name: Upload (Win64)
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.mode == 'win64' }}
uses: actions/upload-artifact@v2
with:
name: win64
path: bin
- name: Upload (Win32)
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.mode == 'win32' }}
uses: actions/upload-artifact@v2
with:
name: win32
path: bin