|
| 1 | +name: GNUStep |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + pull_request: |
| 7 | + |
| 8 | +env: |
| 9 | + CARGO_TERM_COLOR: always |
| 10 | + RUST_BACKTRACE: 1 |
| 11 | + # Faster compilation and error on warnings |
| 12 | + RUSTFLAGS: "-C debuginfo=0 -D warnings" |
| 13 | + CC: clang |
| 14 | + CXX: clang++ |
| 15 | + |
| 16 | +jobs: |
| 17 | + test: |
| 18 | + name: Test |
| 19 | + # TODO: 32bit and gcc-multilib |
| 20 | + runs-on: ubuntu-latest |
| 21 | + |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v2 |
| 24 | + |
| 25 | + - name: Install Clang |
| 26 | + run: sudo apt-get install clang |
| 27 | + |
| 28 | + - name: Cache GNUStep |
| 29 | + id: cache-gnustep |
| 30 | + uses: actions/cache@v2 |
| 31 | + 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 | + # - ... |
| 42 | + path: | |
| 43 | + ~/gnustep/lib |
| 44 | + ~/gnustep/include |
| 45 | + key: gnustep-libobjc2_1.9-make_2.9.0-base_1.28.0 |
| 46 | + |
| 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 |
| 55 | +
|
| 56 | + - name: Install Make |
| 57 | + if: steps.cache-gnustep.outputs.cache-hit != 'true' |
| 58 | + run: sudo apt-get install make |
| 59 | + |
| 60 | + - name: Install GNUStep libobjc2 |
| 61 | + if: steps.cache-gnustep.outputs.cache-hit != 'true' |
| 62 | + run: | |
| 63 | + wget https://github.com/gnustep/libobjc2/archive/refs/tags/v1.9.tar.gz |
| 64 | + tar -xzf v1.9.tar.gz |
| 65 | + mkdir -p libobjc2-1.9/build |
| 66 | + cd libobjc2-1.9/build |
| 67 | + cmake -Wno-dev -DCMAKE_INSTALL_PREFIX=$HOME/gnustep -DTESTS=OFF .. |
| 68 | + make install |
| 69 | +
|
| 70 | + - name: Install GNUStep make |
| 71 | + if: steps.cache-gnustep.outputs.cache-hit != 'true' |
| 72 | + run: | |
| 73 | + wget https://github.com/gnustep/tools-make/archive/refs/tags/make-2_9_0.tar.gz |
| 74 | + tar -xzf make-2_9_0.tar.gz |
| 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 |
| 79 | +
|
| 80 | + - name: Install GNUStep-Base |
| 81 | + if: steps.cache-gnustep.outputs.cache-hit != 'true' |
| 82 | + run: | |
| 83 | + wget https://github.com/gnustep/libs-base/archive/refs/tags/base-1_28_0.tar.gz |
| 84 | + tar -xzf base-1_28_0.tar.gz |
| 85 | + cd libs-base-base-1_28_0 |
| 86 | + ./configure --prefix=$HOME/gnustep --disable-tls --disable-xslt |
| 87 | + make install |
| 88 | + ls -al $HOME/gnustep/* |
| 89 | +
|
| 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 |
| 105 | + |
| 106 | + - name: Test GNUStep |
| 107 | + uses: actions-rs/cargo@v1 |
| 108 | + with: |
| 109 | + command: test |
| 110 | + # Temporary fix |
| 111 | + args: --verbose --no-fail-fast --no-default-features --package objc2_sys --package objc2 --package objc2_encode --package objc2_exception --package objc2_foundation |
| 112 | + |
| 113 | + - name: Test GNUStep with features |
| 114 | + uses: actions-rs/cargo@v1 |
| 115 | + with: |
| 116 | + command: test |
| 117 | + # Temporary fix |
| 118 | + args: --verbose --no-fail-fast --no-default-features --features exception,verify_message --package objc2_sys --package objc2 --package objc2_encode --package objc2_exception --package objc2_foundation |
0 commit comments