Skip to content

Commit 0232abd

Browse files
authored
Merge pull request #1 from bltavares/macos
Macos
2 parents 32e6ad8 + 18a75cc commit 0232abd

8 files changed

Lines changed: 412 additions & 378 deletions

File tree

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
1-
# We could use `@actions-rs/cargo` Action ability to automatically install `cross` tool
2-
# in order to compile our application for some unusual targets.
3-
4-
on: [push, pull_request]
5-
6-
name: Cross-compile
7-
8-
jobs:
9-
build:
10-
name: Build
11-
runs-on: ubuntu-latest
12-
strategy:
13-
matrix:
14-
target:
15-
- armv7-unknown-linux-gnueabihf
16-
- powerpc64-unknown-linux-gnu
17-
- mips-unknown-linux-musl
18-
steps:
19-
- uses: actions/checkout@v2
20-
- uses: actions-rs/toolchain@v1
21-
with:
22-
toolchain: stable
23-
target: ${{ matrix.target }}
24-
override: true
25-
- uses: actions-rs/cargo@v1
26-
with:
27-
use-cross: true
28-
command: build
29-
args: --target=${{ matrix.target }} --examples
1+
# We could use `@actions-rs/cargo` Action ability to automatically install `cross` tool
2+
# in order to compile our application for some unusual targets.
3+
4+
on: [push, pull_request]
5+
6+
name: Cross-compile
7+
8+
jobs:
9+
build:
10+
name: Build
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
target:
15+
- armv7-unknown-linux-gnueabihf
16+
- aarch64-linux-android
17+
- mips-unknown-linux-musl
18+
- x86_64-unknown-linux-musl
19+
- aarch64-unknown-linux-gnu
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: actions-rs/toolchain@v1
23+
with:
24+
toolchain: stable
25+
target: ${{ matrix.target }}
26+
override: true
27+
- uses: actions-rs/cargo@v1
28+
with:
29+
use-cross: true
30+
command: build
31+
args: --target=${{ matrix.target }} --examples

.github/workflows/main.yml

Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,82 @@
1-
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md
2-
#
3-
# While our "example" application has the platform-specific code,
4-
# for simplicity we are compiling and testing everything on the Ubuntu environment only.
5-
# For multi-OS testing see the `cross.yml` workflow.
6-
7-
on: [push, pull_request]
8-
9-
name: Quickstart
10-
11-
jobs:
12-
lints:
13-
name: Lints
14-
runs-on: ubuntu-latest
15-
steps:
16-
- name: Checkout sources
17-
uses: actions/checkout@v2
18-
19-
- name: Install stable toolchain
20-
uses: actions-rs/toolchain@v1
21-
with:
22-
profile: minimal
23-
toolchain: stable
24-
override: true
25-
components: rustfmt
26-
# components: rustfmt, clippy
27-
28-
- name: Run cargo fmt
29-
uses: actions-rs/cargo@v1
30-
with:
31-
command: fmt
32-
args: --all -- --check
33-
34-
# TODO enable clippy when unsafe calls are fixed
35-
# - name: Run cargo clippy
36-
# run: cargo clippy -- -D warnings
37-
38-
check:
39-
name: Check
40-
runs-on: ${{matrix.os}}
41-
strategy:
42-
matrix:
43-
os: [ubuntu-latest, windows-latest, macos-latest]
44-
steps:
45-
- name: Checkout sources
46-
uses: actions/checkout@v2
47-
48-
- name: Install stable toolchain
49-
uses: actions-rs/toolchain@v1
50-
with:
51-
profile: minimal
52-
toolchain: stable
53-
override: true
54-
55-
- name: Run cargo check
56-
uses: actions-rs/cargo@v1
57-
with:
58-
command: check
59-
args: --examples
60-
61-
test:
62-
name: Test Suite
63-
runs-on: ${{matrix.os}}
64-
strategy:
65-
matrix:
66-
os: [ubuntu-latest, windows-latest, macos-latest]
67-
steps:
68-
- name: Checkout sources
69-
uses: actions/checkout@v2
70-
71-
- name: Install stable toolchain
72-
uses: actions-rs/toolchain@v1
73-
with:
74-
profile: minimal
75-
toolchain: stable
76-
override: true
77-
78-
- name: Run cargo build
79-
uses: actions-rs/cargo@v1
80-
with:
81-
command: build
82-
args: --examples
1+
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md
2+
#
3+
# While our "example" application has the platform-specific code,
4+
# for simplicity we are compiling and testing everything on the Ubuntu environment only.
5+
# For multi-OS testing see the `cross.yml` workflow.
6+
7+
on: [push, pull_request]
8+
9+
name: Quickstart
10+
11+
jobs:
12+
lints:
13+
name: Lints
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout sources
17+
uses: actions/checkout@v2
18+
19+
- name: Install stable toolchain
20+
uses: actions-rs/toolchain@v1
21+
with:
22+
profile: minimal
23+
toolchain: stable
24+
override: true
25+
components: rustfmt
26+
# components: rustfmt, clippy
27+
28+
- name: Run cargo fmt
29+
uses: actions-rs/cargo@v1
30+
with:
31+
command: fmt
32+
args: --all -- --check
33+
34+
# TODO enable clippy when unsafe calls are fixed
35+
# - name: Run cargo clippy
36+
# run: cargo clippy -- -D warnings
37+
38+
check:
39+
name: Check
40+
runs-on: ${{matrix.os}}
41+
strategy:
42+
matrix:
43+
os: [ubuntu-latest, windows-latest, macos-latest]
44+
steps:
45+
- name: Checkout sources
46+
uses: actions/checkout@v2
47+
48+
- name: Install stable toolchain
49+
uses: actions-rs/toolchain@v1
50+
with:
51+
profile: minimal
52+
toolchain: stable
53+
override: true
54+
55+
- name: Run cargo check
56+
uses: actions-rs/cargo@v1
57+
with:
58+
command: check
59+
args: --examples
60+
61+
test:
62+
name: Test Suite
63+
runs-on: ${{matrix.os}}
64+
strategy:
65+
matrix:
66+
os: [ubuntu-latest, windows-latest, macos-latest]
67+
steps:
68+
- name: Checkout sources
69+
uses: actions/checkout@v2
70+
71+
- name: Install stable toolchain
72+
uses: actions-rs/toolchain@v1
73+
with:
74+
profile: minimal
75+
toolchain: stable
76+
override: true
77+
78+
- name: Run cargo build
79+
uses: actions-rs/cargo@v1
80+
with:
81+
command: build
82+
args: --examples

Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ version = '0.3.9'
2222
features = ['mswsock']
2323

2424
[target."cfg(not(windows))".dependencies.nix]
25-
version = '0.17.0'
25+
# Needs https://github.com/nix-rust/nix/pull/1222 which is unreleased as of today
26+
# version = '0.18.0'
27+
git = "https://github.com/nix-rust/nix"
2628

2729
[target."cfg(not(windows))".dependencies.libc]
28-
version = '0.2.71'
30+
# Needs to be the same as the version used by nix
31+
git = "https://github.com/rust-lang/libc"

0 commit comments

Comments
 (0)