Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Actions #1598

Merged
merged 11 commits into from Jul 19, 2022
148 changes: 148 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,148 @@
name: CI
on:
push:
branches: [ "master", "v0.6.x", "v0.7.x" ]
pull_request:
branches: [ "master", "v0.6.x", "v0.7.x" ]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
CI: true
jobs:
Test:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install Cargo-hack
run: cargo install --debug cargo-hack
- name: Check all features
run: cargo hack check --feature-powerset
- name: Tests
run: cargo test --all-features
- name: Tests release build
run: cargo test --release --all-features
MinimalVersions:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Install minimal verions
run: cargo update -Zminimal-versions
- name: Tests
run: cargo test --all-features
MSRV:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.46.0
override: true
- name: Check
# We only run check allowing us to use newer features in tests.
run: cargo check --all-features
Nightly:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Tests
run: cargo test --all-features
Clippy:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings -A clippy::cognitive-complexity
Docs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Check docs
run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features
Rustfmt:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Check formatting
# FIXME: for some reason this doesn't actually check all files.
# So instead we run `rustfmt` directly on each file.
#cargo fmt --all -- --check
run: find src tests examples -type f -iname "*.rs" | xargs rustfmt --check
CheckTargets:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- name: Install all targets
run: make install_targets
- name: Install Cargo-hack
run: cargo install --debug cargo-hack
- name: Check all targets
run: make check_all_targets
# Single job required to merge the pr.
Passed:
runs-on: ubuntu-latest
needs:
- Test
- MinimalVersions
- MSRV
- Nightly
- Clippy
- Docs
- Rustfmt
- CheckTargets
steps:
- run: exit 0
2 changes: 1 addition & 1 deletion Makefile
@@ -1,5 +1,5 @@
# Targets available via Rustup that are supported.
TARGETS ?= aarch64-apple-ios aarch64-linux-android x86_64-apple-darwin x86_64-pc-windows-msvc x86_64-unknown-freebsd x86_64-unknown-illumos x86_64-unknown-linux-gnu x86_64-unknown-netbsd
TARGETS ?= aarch64-apple-ios aarch64-linux-android arm-linux-androideabi i686-unknown-linux-gnu x86_64-apple-darwin x86_64-apple-ios x86_64-pc-windows-msvc x86_64-unknown-freebsd x86_64-unknown-illumos x86_64-unknown-linux-gnu x86_64-unknown-netbsd x86_64-unknown-redox

test:
cargo test --all-features
Expand Down
65 changes: 0 additions & 65 deletions azure-pipelines.yml

This file was deleted.

17 changes: 0 additions & 17 deletions ci/azure-clippy.yml

This file was deleted.

59 changes: 0 additions & 59 deletions ci/azure-cross-compile.yml

This file was deleted.

38 changes: 0 additions & 38 deletions ci/azure-deploy-docs.yml

This file was deleted.

33 changes: 0 additions & 33 deletions ci/azure-install-rust.yml

This file was deleted.