Skip to content

Commit

Permalink
Merge pull request #1 from bltavares/macos
Browse files Browse the repository at this point in the history
Macos
  • Loading branch information
bltavares authored Jun 30, 2020
2 parents 32e6ad8 + 18a75cc commit 0232abd
Show file tree
Hide file tree
Showing 8 changed files with 412 additions and 378 deletions.
60 changes: 31 additions & 29 deletions .github/workflows/cross_compile.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
# We could use `@actions-rs/cargo` Action ability to automatically install `cross` tool
# in order to compile our application for some unusual targets.

on: [push, pull_request]

name: Cross-compile

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
target:
- armv7-unknown-linux-gnueabihf
- powerpc64-unknown-linux-gnu
- mips-unknown-linux-musl
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target=${{ matrix.target }} --examples
# We could use `@actions-rs/cargo` Action ability to automatically install `cross` tool
# in order to compile our application for some unusual targets.

on: [push, pull_request]

name: Cross-compile

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
target:
- armv7-unknown-linux-gnueabihf
- aarch64-linux-android
- mips-unknown-linux-musl
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target=${{ matrix.target }} --examples
164 changes: 82 additions & 82 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,82 +1,82 @@
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md
#
# While our "example" application has the platform-specific code,
# for simplicity we are compiling and testing everything on the Ubuntu environment only.
# For multi-OS testing see the `cross.yml` workflow.

on: [push, pull_request]

name: Quickstart

jobs:
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
# components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

# TODO enable clippy when unsafe calls are fixed
# - name: Run cargo clippy
# run: cargo clippy -- -D warnings

check:
name: Check
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --examples

test:
name: Test Suite
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Run cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --examples
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md
#
# While our "example" application has the platform-specific code,
# for simplicity we are compiling and testing everything on the Ubuntu environment only.
# For multi-OS testing see the `cross.yml` workflow.

on: [push, pull_request]

name: Quickstart

jobs:
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
# components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

# TODO enable clippy when unsafe calls are fixed
# - name: Run cargo clippy
# run: cargo clippy -- -D warnings

check:
name: Check
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --examples

test:
name: Test Suite
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Run cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --examples
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ version = '0.3.9'
features = ['mswsock']

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

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

0 comments on commit 0232abd

Please # to comment.