Skip to content

Commit d9161e3

Browse files
committed
Move workflows to separate files
Causes a bit more duplication, but allows us to focus on the platform at hand
1 parent 1ded654 commit d9161e3

File tree

2 files changed

+85
-66
lines changed

2 files changed

+85
-66
lines changed

.github/workflows/apple.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Apple
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+
14+
jobs:
15+
fmt:
16+
name: Check formatting
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Check formatting
21+
uses: actions-rs/cargo@v1
22+
with:
23+
command: fmt
24+
args: -- --check
25+
26+
test:
27+
name: Test
28+
strategy:
29+
matrix:
30+
platform:
31+
- { os: macos-10.15 }
32+
- { os: macos-11 }
33+
# - { target: x86_64-apple-ios, os: macos-latest, }
34+
# - { target: aarch64-apple-ios, os: macos-latest, }
35+
36+
runs-on: ${{ matrix.platform.os }}
37+
38+
steps:
39+
- uses: actions/checkout@v2
40+
41+
- name: Cache Rust
42+
uses: actions/cache@v2
43+
with:
44+
path: |
45+
~/.cargo/
46+
target/
47+
key: ${{ matrix.platform.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
48+
restore-keys: |
49+
${{ matrix.platform.os }}-cargo-
50+
51+
- name: Install different Rust toolchain
52+
# A default toolchain is already installed
53+
if: matrix.platform.target
54+
uses: actions-rs/toolchain@v1
55+
with:
56+
toolchain: stable
57+
target: ${{ matrix.platform.target }}
58+
profile: minimal
59+
override: true
60+
61+
- name: Check documentation
62+
uses: actions-rs/cargo@v1
63+
with:
64+
# TODO: Disallow warnings here
65+
command: doc
66+
args: --no-deps --document-private-items
67+
68+
- name: Test without features
69+
uses: actions-rs/cargo@v1
70+
with:
71+
command: test
72+
args: --verbose --no-fail-fast --no-default-features
73+
74+
- name: Test with features
75+
uses: actions-rs/cargo@v1
76+
with:
77+
command: test
78+
# Not using --all-features because some features are nightly-only
79+
args: --verbose --no-fail-fast --features block,exception,verify_message
Lines changed: 6 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
name: CI
1+
name: GNUStep
22

33
on:
4-
push:
5-
branches: [master]
64
pull_request:
75

86
env:
@@ -14,29 +12,10 @@ env:
1412
CXX: clang++
1513

1614
jobs:
17-
fmt:
18-
name: Check formatting
19-
runs-on: ubuntu-latest
20-
steps:
21-
- uses: actions/checkout@v2
22-
- name: Check formatting
23-
uses: actions-rs/cargo@v1
24-
with:
25-
command: fmt
26-
args: -- --check
27-
2815
test:
2916
name: Test
30-
strategy:
31-
matrix:
32-
platform:
33-
- { os: ubuntu-latest } # TODO: 32bit and gcc-multilib
34-
- { os: macos-10.15 }
35-
- { os: macos-11 }
36-
# - { target: x86_64-apple-ios, os: macos-latest, }
37-
# - { target: aarch64-apple-ios, os: macos-latest, }
38-
39-
runs-on: ${{ matrix.platform.os }}
17+
# TODO: 32bit and gcc-multilib
18+
runs-on: ubuntu-latest
4019

4120
steps:
4221
- uses: actions/checkout@v2
@@ -47,31 +26,13 @@ jobs:
4726
path: |
4827
~/.cargo/
4928
target/
50-
key: ${{ matrix.platform.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
29+
key: gnustep-cargo-${{ hashFiles('**/Cargo.toml') }}
5130
restore-keys: |
52-
${{ matrix.platform.os }}-cargo-
31+
gnustep-cargo-
5332
5433
- name: Install Packages
55-
if: contains(matrix.platform.os, 'ubuntu')
5634
run: sudo apt-get install gobjc clang make libblocksruntime-dev
5735

58-
- name: Install different Rust toolchain
59-
# A default toolchain is already installed
60-
if: matrix.platform.target
61-
uses: actions-rs/toolchain@v1
62-
with:
63-
toolchain: stable
64-
target: ${{ matrix.platform.target }}
65-
profile: minimal
66-
override: true
67-
68-
- name: Check documentation
69-
uses: actions-rs/cargo@v1
70-
with:
71-
# TODO: Disallow warnings here
72-
command: doc
73-
args: --no-deps --document-private-items
74-
7536
- # Run before we install GNUStep as a "fail fast" mechanism
7637
name: Run checks
7738
uses: actions-rs/cargo@v1
@@ -80,17 +41,15 @@ jobs:
8041
args: --verbose --no-default-features
8142

8243
- name: Install GNUStep libobjc2
83-
if: contains(matrix.platform.os, 'ubuntu')
8444
run: |
8545
wget https://github.com/gnustep/libobjc2/archive/refs/tags/v1.9.tar.gz
8646
tar -xzf v1.9.tar.gz
87-
mkdir libobjc2-1.9/build
47+
mkdir -p libobjc2-1.9/build
8848
cd libobjc2-1.9/build
8949
cmake ../
9050
sudo make install
9151
9252
- name: Install GNUStep make
93-
if: contains(matrix.platform.os, 'ubuntu')
9453
run: |
9554
wget https://github.com/gnustep/tools-make/archive/refs/tags/make-2_9_0.tar.gz
9655
tar -xzf make-2_9_0.tar.gz
@@ -99,7 +58,6 @@ jobs:
9958
sudo make install
10059
10160
- name: Install GNUStep-Base
102-
if: contains(matrix.platform.os, 'ubuntu')
10361
run: |
10462
wget https://github.com/gnustep/libs-base/archive/refs/tags/base-1_28_0.tar.gz
10563
tar -xzf base-1_28_0.tar.gz
@@ -108,7 +66,6 @@ jobs:
10866
sudo make install
10967
11068
- name: Setup environment
111-
if: contains(matrix.platform.os, 'ubuntu')
11269
run: |
11370
ls -al /usr/local/lib
11471
ls -al /usr/local/include
@@ -117,32 +74,15 @@ jobs:
11774
echo "CPATH=/usr/local/include:$CPATH" >> $GITHUB_ENV
11875
11976
- name: Test GNUStep
120-
if: contains(matrix.platform.os, 'ubuntu')
12177
uses: actions-rs/cargo@v1
12278
with:
12379
command: test
12480
# Temporary fix
12581
args: --verbose --no-fail-fast --no-default-features --package objc2_sys --package objc2 --package objc2_encode --package objc2_exception --package objc2_foundation
12682

12783
- name: Test GNUStep with features
128-
if: contains(matrix.platform.os, 'ubuntu')
12984
uses: actions-rs/cargo@v1
13085
with:
13186
command: test
13287
# Temporary fix
13388
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
134-
135-
- name: Test
136-
if: ${{ !contains(matrix.platform.os, 'ubuntu') }}
137-
uses: actions-rs/cargo@v1
138-
with:
139-
command: test
140-
args: --verbose --no-fail-fast --no-default-features
141-
142-
- name: Test with features
143-
if: ${{ !contains(matrix.platform.os, 'ubuntu') }}
144-
uses: actions-rs/cargo@v1
145-
with:
146-
command: test
147-
# Not using --all-features because some features are nightly-only
148-
args: --verbose --no-fail-fast --features block,exception,verify_message

0 commit comments

Comments
 (0)