Skip to content

Commit

Permalink
feat: Expand platform support (messense#43)
Browse files Browse the repository at this point in the history
* Better Apple support

* Rename job

* Correct spelling mistakes

* Newer actions checkout

* Proper and

* Happy

* Install corret CI

* Build std

* version bump

* Show nightly only feature when building documentation

* Update CI

* Add toolchain

* Apply automated improvements

* Cast mut was a mistake

* Speed up the CI

* Well that should work

* Version is too old

* Add FreeBSD CI

* Support NetBSD and FreeBSD

* Add corret bsd flags

* Add other BSD unix

* Remove openbsd

* Remove unnecessary targets
  • Loading branch information
umgefahren committed Aug 5, 2024
1 parent 5948a71 commit 605f750
Show file tree
Hide file tree
Showing 5 changed files with 178 additions and 81 deletions.
57 changes: 22 additions & 35 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@ jobs:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: check
- name: Run check
run: cargo check

test:
name: Test Suite
Expand All @@ -25,49 +22,39 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: ["1.56.0", stable]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
if: ${{ matrix.os == 'macos-latest' && matrix.rust == '1.56.0' }}
with:
xcode-version: latest-stable
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- uses: dtolnay/rust-toolchain@stable
if: ${{ matrix.rust == 'stable' }}
- uses: dtolnay/rust-toolchain@1.56.0
if: ${{ matrix.rust == '1.56.0' }}
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
run: cargo build
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: -- --show-output
run: cargo test -- --show-output

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
command: fmt
args: --all -- --check
components: rustfmt
- name: Run fmt
run: cargo fmt --all -- --check

clippy_check:
name: Clippy Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: rustup component add clippy
- uses: actions-rs/clippy-check@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
components: clippy
- uses: r7kamura/rust-problem-matchers@9fe7ca9f6550e5d6358e179d451cc25ea6b54f98 #v1.5.0
- name: Run clippy
run: cargo clippy --all-features
52 changes: 30 additions & 22 deletions .github/workflows/Cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,44 @@ jobs:
matrix:
target:
- aarch64-linux-android
- x86_64-unknown-freebsd
- x86_64-unknown-netbsd
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target=${{ matrix.target }}
- name: Build
run: cargo build --target=${{ matrix.target }}

ios:
name: iOS Build
apple:
name: Apple Build on ${{ matrix.target }}
runs-on: macos-latest
strategy:
matrix:
target:
- aarch64-apple-ios
- x86_64-apple-ios
include:
- target: aarch64-apple-ios
tier3: false
- target: aarch64-apple-watchos
tier3: true
- target: aarch64-apple-tvos
tier3: true
- target: aarch64-apple-visionos
tier3: true
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
if: ${{ !matrix.tier3 }}
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: actions-rs/cargo@v1
toolchain: 'stable'
targets: ${{ matrix.target }}
components: rust-src
- uses: dtolnay/rust-toolchain@master
if: ${{ matrix.tier3 }}
with:
use-cross: true
command: build
args: --target=${{ matrix.target }}
toolchain: 'nightly'
components: rust-src

- name: Build
run: cargo build --target ${{ matrix.target }} ${{ matrix.tier3 && '-Zbuild-std' || '' }}
8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license = "MIT OR BSD-3-Clause"
name = "if-addrs"
readme = "README.md"
repository = "https://github.com/messense/if-addrs"
version = "0.13.1"
version = "0.13.2"
edition = "2021"

[target.'cfg(not(target_os = "windows"))'.dependencies]
Expand All @@ -25,3 +25,9 @@ features = [

[features]
link-local = []

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
targets = ["x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "aarch64-apple-ios", "aarch64-apple-watchos", "aarch64-apple-tvos", "aarch64-apple-visionos"]
cargo-args = ["-Z", "build-std"]
Loading

0 comments on commit 605f750

Please sign in to comment.