Skip to content

Commit

Permalink
Merge branch 'master' into system-name-generic
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 authored Aug 15, 2024
2 parents a1192a1 + f84bd51 commit 3dc2a6d
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 115 deletions.
102 changes: 67 additions & 35 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
name: CI
on: [push, pull_request]

env:
RUSTDOCFLAGS: -D warnings
RUSTFLAGS: -D warnings

jobs:
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: |
rustup update beta --no-self-update
rustup default beta
rustup component add clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-features --all-targets -- -D warnings

test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [stable, beta, nightly]
rust: ["1.70", stable, beta, nightly]
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
run: |
rustup update ${{ matrix.rust }} --no-self-update
rustup default ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
- run: cargo test
- name: Integration test
run: cargo test --manifest-path test-crate/Cargo.toml

rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
- run: cargo fmt -- --check

cross_compile_test:
name: Test Cross Compile - ${{ matrix.platform.target }}
needs: [ test ]
Expand All @@ -39,14 +50,6 @@ jobs:
test: true
- target: arm-unknown-linux-gnueabihf
test: true
- target: mips-unknown-linux-gnu
test: true
- target: mips64-unknown-linux-gnuabi64
test: true
- target: mips64el-unknown-linux-gnuabi64
test: true
- target: mipsel-unknown-linux-gnu
test: true
- target: powerpc-unknown-linux-gnu
test: true
- target: s390x-unknown-linux-gnu
Expand All @@ -55,26 +58,29 @@ jobs:
test: true
- target: aarch64-unknown-linux-musl
test: true
- target: x86_64-pc-windows-gnu
test: true
# Build only
- target: x86_64-unknown-freebsd
- target: x86_64-pc-solaris
test: false
- target: x86_64-unknown-netbsd
- target: x86_64-pc-windows-gnu
test: false
- target: x86_64-sun-solaris
# FIXME: build fails, see <https://github.com/rust-lang/cmake-rs/issues/211>
# - target: x86_64-unknown-freebsd
# test: false
- target: x86_64-unknown-netbsd
test: false
- target: x86_64-unknown-illumos
test: false
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.platform.target }}
- uses: taiki-e/install-action@v1
- name: Install Rust
run: |
rustup update stable --no-self-update
rustup default stable
rustup target add ${{ matrix.platform.target }}
- uses: taiki-e/install-action@v2
with:
tool: cross
- uses: Swatinem/rust-cache@v2
- name: cross test
run: cross test -vv --target ${{ matrix.platform.target }}
working-directory: test-crate
Expand All @@ -94,14 +100,40 @@ jobs:
platform:
- target: aarch64-apple-ios
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.platform.target }}
- uses: actions/checkout@v4
- name: Install Rust
run: |
rustup update stable --no-self-update
rustup default stable
rustup target add ${{ matrix.platform.target }}
- uses: Swatinem/rust-cache@v2
- name: build
run: cargo build -vv --target ${{ matrix.platform.target }}
working-directory: test-crate
env:
# If this isn't specified the default is iOS 7, for which zlib-ng will not compile due to the lack of thread-local storage.
IPHONEOS_DEPLOYMENT_TARGET: 16

rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
run: |
rustup update stable --no-self-update
rustup default stable
rustup component add rustfmt
- run: cargo fmt --all -- --check

doc:
name: docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
rustup update nightly --no-self-update
rustup default nightly
- uses: Swatinem/rust-cache@v2
- run: cargo doc

27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release-plz

permissions:
pull-requests: write
contents: write

on:
push:
branches:
- master

jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust (rustup)
run: rustup update stable --no-self-update && rustup default stable
- name: Run release-plz
uses: MarcoIeni/release-plz-action@v0.5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
2 changes: 2 additions & 0 deletions .release-plz.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[workspace]
git_tag_name = "v{{ version }}"
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ categories = ["development-tools::build-utils"]
edition = "2021"

[dependencies]
cc = "1.0.72"
cc = "1.0.83"
Loading

0 comments on commit 3dc2a6d

Please sign in to comment.