Skip to content

Commit 42a1f7f

Browse files
committed
Setup GNUStep caching
After ~70 workflow runs and _many_ hours, I finally figured out a solution that works... Damn I hate creating workflow files
1 parent d9161e3 commit 42a1f7f

File tree

2 files changed

+59
-29
lines changed

2 files changed

+59
-29
lines changed

.github/workflows/apple.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
with:
6464
# TODO: Disallow warnings here
6565
command: doc
66-
args: --no-deps --document-private-items
66+
args: --verbose --no-deps --document-private-items
6767

6868
- name: Test without features
6969
uses: actions-rs/cargo@v1

.github/workflows/gnustep.yml

Lines changed: 58 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: GNUStep
22

33
on:
4+
push:
5+
branches: [master]
46
pull_request:
57

68
env:
@@ -20,58 +22,86 @@ jobs:
2022
steps:
2123
- uses: actions/checkout@v2
2224

23-
- name: Cache Rust
25+
- name: Install Clang
26+
run: sudo apt-get install clang
27+
28+
- name: Cache GNUStep
29+
id: cache-gnustep
2430
uses: actions/cache@v2
2531
with:
32+
# Ideally I would have just cached build-files, and then rerun make
33+
# every time, letting it figure out what's changed. But GNUStep-Base
34+
# ./configure invalidates the cache, which makes it very hard to
35+
# know when to rebuild and when not to.
36+
# So instead we just cache the final output:
37+
# - lib/libobjc.so
38+
# - lib/libgnustep-base.so
39+
# - include/Foundation/*
40+
# - include/objc/*
41+
# - ...
2642
path: |
27-
~/.cargo/
28-
target/
29-
key: gnustep-cargo-${{ hashFiles('**/Cargo.toml') }}
30-
restore-keys: |
31-
gnustep-cargo-
43+
~/gnustep/lib
44+
~/gnustep/include
45+
key: gnustep-libobjc2_1.9-make_2.9.0-base_1.28.0
3246

33-
- name: Install Packages
34-
run: sudo apt-get install gobjc clang make libblocksruntime-dev
47+
- name: Setup environment
48+
run: |
49+
mkdir -p $HOME/gnustep
50+
echo "PATH=$HOME/gnustep/bin:$PATH" >> $GITHUB_ENV
51+
echo "LIBRARY_PATH=$HOME/gnustep/lib:$LIBRARY_PATH" >> $GITHUB_ENV
52+
echo "LD_LIBRARY_PATH=$HOME/gnustep/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
53+
echo "CPATH=$HOME/gnustep/include:$CPATH" >> $GITHUB_ENV
54+
ls -al ~/gnustep/* || true # Ignore failures
3555
36-
- # Run before we install GNUStep as a "fail fast" mechanism
37-
name: Run checks
38-
uses: actions-rs/cargo@v1
39-
with:
40-
command: check
41-
args: --verbose --no-default-features
56+
- name: Install Make
57+
if: steps.cache-gnustep.outputs.cache-hit != 'true'
58+
run: sudo apt-get install make
4259

4360
- name: Install GNUStep libobjc2
61+
if: steps.cache-gnustep.outputs.cache-hit != 'true'
4462
run: |
4563
wget https://github.com/gnustep/libobjc2/archive/refs/tags/v1.9.tar.gz
4664
tar -xzf v1.9.tar.gz
4765
mkdir -p libobjc2-1.9/build
4866
cd libobjc2-1.9/build
49-
cmake ../
50-
sudo make install
67+
cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=$HOME/gnustep -DTESTS=OFF ..
68+
make install
5169
5270
- name: Install GNUStep make
71+
if: steps.cache-gnustep.outputs.cache-hit != 'true'
5372
run: |
5473
wget https://github.com/gnustep/tools-make/archive/refs/tags/make-2_9_0.tar.gz
5574
tar -xzf make-2_9_0.tar.gz
56-
cd tools-make-make-2_9_0
57-
./configure --with-library-combo=ng-gnu-gnu
58-
sudo make install
75+
mkdir -p tools-make-make-2_9_0/build
76+
cd tools-make-make-2_9_0/build
77+
../configure --prefix=$HOME/gnustep --with-library-combo=ng-gnu-gnu
78+
make install
5979
6080
- name: Install GNUStep-Base
81+
if: steps.cache-gnustep.outputs.cache-hit != 'true'
6182
run: |
6283
wget https://github.com/gnustep/libs-base/archive/refs/tags/base-1_28_0.tar.gz
6384
tar -xzf base-1_28_0.tar.gz
6485
cd libs-base-base-1_28_0
65-
./configure --disable-tls
66-
sudo make install
86+
./configure --prefix=$HOME/gnustep --disable-tls --disable-xslt
87+
make install
88+
ls -al $HOME/gnustep/*
6789
68-
- name: Setup environment
69-
run: |
70-
ls -al /usr/local/lib
71-
ls -al /usr/local/include
72-
echo "LIBRARY_PATH=/usr/local/lib:$LIBRARY_PATH" >> $GITHUB_ENV
73-
echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
74-
echo "CPATH=/usr/local/include:$CPATH" >> $GITHUB_ENV
90+
- name: Cache Rust
91+
uses: actions/cache@v2
92+
with:
93+
path: |
94+
~/.cargo/
95+
target/
96+
key: gnustep-cargo-${{ hashFiles('**/Cargo.toml') }}
97+
restore-keys: |
98+
gnustep-cargo-
99+
100+
- name: Run checks
101+
uses: actions-rs/cargo@v1
102+
with:
103+
command: check
104+
args: --verbose --no-default-features
75105

76106
- name: Test GNUStep
77107
uses: actions-rs/cargo@v1

0 commit comments

Comments
 (0)