forked from emacs-ng/emacs-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
198 lines (170 loc) · 8.53 KB
/
test.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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: CI
on: [push, pull_request]
jobs:
rustfmt-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: rust setup
id: rust-setup
run: |
rustup install $(cat rust-toolchain)
rustup component add rustfmt-preview
echo "::set-output name=week::$(/bin/date -u '+%Yy_%mm_%Ww')"
- name: rust cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/cache
~/.cargo/git
./target
key: |
${{ runner.os }}-${{ matrix.build }}-deno-v1.9.2-rust-${{ hashFiles('**/test.yml', '**/rust-toolchain', '**/rustfmt.toml') }}-${{ steps.rust-setup.outputs.week }}
restore-keys: |
${{ runner.os }}-${{ matrix.build }}-deno-v1.9.2-rust-${{ hashFiles('**/test.yml', '**/rust-toolchain', '**/rustfmt.toml') }}-${{ steps.rust-setup.outputs.week }}
${{ runner.os }}-${{ matrix.build }}-deno-v1.9.2-rust-${{ hashFiles('**/test.yml', '**/rust-toolchain', '**/rustfmt.toml') }}-
${{ runner.os }}-${{ matrix.build }}-deno-v1.9.2-rust
- name: cache cleanup
if: steps.rust-cache.outputs.cache-hit != 'true'
run: |
## Cargo Cache Clean
cargo install cargo-cache --no-default-features --features ci-autoclean cargo-cache
cargo-cache
cargo uninstall cargo-cache
- name: Install dependencies on Linux
if: runner.os == 'Linux'
run: |
## Package Install
sudo apt update
sudo apt install -y libgnutls28-dev
- name: configure
run: |
./autogen.sh
./configure --without-makeinfo --with-x=no --with-ns=no --without-gconf --without-gsettings
- name: rust fmt
run: |
# Configure $PATH: Executables are installed to $HOME/bin
export PATH="$HOME/bin:$PATH"
admin/format-rust.sh
build-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
build: general
- os: ubuntu-latest
build: webrender
- os: macos-latest
build: general
- os: macos-latest
build: webrender
steps:
- uses: actions/checkout@v4
- name: rust setup
id: rust-setup
run: |
rustup install $(cat rust-toolchain)
echo "::set-output name=week::$(/bin/date -u '+%Yy_%mm_%Ww')"
- name: rust cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/cache
~/.cargo/git
./target
key: |
${{ runner.os }}-${{ matrix.build }}-rust-deno-v1.9.2-${{ hashFiles('**/test.yml', '**/rust-toolchain', '**/Cargo.toml*') }}-${{ steps.rust-setup.outputs.week }}
restore-keys: |
${{ runner.os }}-${{ matrix.build }}-rust-deno-v1.9.2-${{ hashFiles('**/test.yml', '**/rust-toolchain', '**/Cargo.toml*') }}-${{ steps.rust-setup.outputs.week }}
${{ runner.os }}-${{ matrix.build }}-rust-deno-v1.9.2-${{ hashFiles('**/test.yml', '**/rust-toolchain', '**/Cargo.toml*') }}-
${{ runner.os }}-${{ matrix.build }}-rust-deno-v1.9.2-
- name: cache cleanup
if: steps.rust-cache.outputs.cache-hit != 'true'
run: |
## Cargo Cache Clean
cargo install cargo-cache --no-default-features --features ci-autoclean cargo-cache
cargo-cache
cargo uninstall cargo-cache
- name: c cache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ runner.os }}-${{ matrix.build }}-ccache
- name: Install dependencies on Linux
if: runner.os == 'Linux'
run: |
## Package Install
sudo apt update
sudo apt install -y libxpm-dev libgtk2.0-dev libgif-dev libgnutls28-dev libx11-xcb-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev clang llvm lld
# Already installed: automake autoconf texinfo libjpeg-dev libpng-dev libtiff-dev libx11-dev libncurses-dev zlib1g-dev
# When use native-comp: libgccjit-9-dev
# When use gcc: build-essential
- name: Install dependencies on macOS
if: runner.os == 'macOS'
run: |
## Package Install
brew install texinfo automake pkg-config
# Already intalled: gnutls autoconf llvm
# Option: libx11 libxpm jpeg libpng giflib libtiff gtk+3 ncurses
# When use native-comp: libgccjit
## Set Path
echo "/usr/local/opt/llvm/bin" >> $GITHUB_PATH
echo "$HOME/bin" >> $GITHUB_PATH
# TODO for native-comp: export LDFLAGS="-L/usr/local/Cellar/libgccjit/10.2.0_1/lib/gcc/10"
- name: common env set
run: |
# autogen
./autogen.sh
## Set env
# Path Set
echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
# Compile with clang
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
echo "CPP=clang -E" >> $GITHUB_ENV
echo "CFLAGS= -g1 -O2" >> $GITHUB_ENV
echo "CXXFLAGS= -g1 -O2" >> $GITHUB_ENV
# Other Flags
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
echo "RUSTFLAGS=-Zshare-generics=y -Cdebuginfo=1 -Copt-level=0" >> $GITHUB_ENV
- name: env(for linux)
if: runner.os == 'Linux'
run: |
echo "LD=lld" >> $GITHUB_ENV
echo "CFLAGS=$CFLAGS -fuse-ld=lld -lxcb-render -lxcb-xfixes -lxcb-shape" >> $GITHUB_ENV
echo "CXXFLAGS=$CXXFLAGS -fuse-ld=lld" >> $GITHUB_ENV
echo "RUSTFLAGS=$RUSTFLAGS -Clink-arg=-fuse-ld=lld" >> $GITHUB_ENV
echo "NPROC=nproc" >> $GITHUB_ENV
- name: env(for mac)
if: runner.os == 'macOS'
run: |
echo "CPLUS_INCLUD=$(/usr/local/opt/llvm/bin/llvm-config --includedir):$CPLUS_INCLUDE_PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$(/usr/local/opt/llvm/bin/llvm-config --libdir):$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "CFLAGS=$CFLAGS -march=native" >> $GITHUB_ENV
echo "CXXFLAGS=$CXXFLAGS -march=native" >> $GITHUB_ENV
echo "RUSTFLAGS=$RUSTFLAGS -Ctarget-cpu=native" >> $GITHUB_ENV
## nproc for mac
# https://github.com/memkind/memkind/issues/33
echo "NPROC=sysctl -n hw.logicalcpu" >> $GITHUB_ENV
- name: configure(general)
if: ${{ matrix.build == 'general' }}
run: |
./configure --enable-checking=glyphs --enable-rust-debug
- name: configure(webrender)
if: ${{ matrix.build == 'webrender' }}
run: |
./configure --enable-checking=glyphs --enable-rust-debug --with-webrender --with-winit
- name: build
run: |
# Avoid lisp compile && make info.
# lib -> lib-src -> src -> lisp -> info
make -j$((`$NPROC`+1)) src
## Reduce Cache
# Note that all of the above need to be repeated for `release/` instead of
# `debug/` if your build script builds artifacts in release mode.
# https://bheisler.github.io/post/efficient-use-of-travis-ci-cache-for-rust/
# Delete loose files in the debug directory
find ./target/debug -maxdepth 1 -type f -delete
# Delete just meta data
rm -f ./target/.rustc_info.json