Skip to content

ci

ci #655

Workflow file for this run

name: ci
on:
push:
branches:
- "master"
- "**_ci"
pull_request:
schedule:
- cron: "0 1 * * 0"
env:
CARGO_TERM_COLOR: always
jobs:
ci:
runs-on: ${{ matrix.runs_on }}
strategy:
matrix:
rust:
- stable
- beta
- 1.70.0 # MSRV
runs_on:
- ubuntu-latest
- windows-latest
- macos-latest
feature:
- net-std
- net-async-std
- net-tokio
- net-smol
- default
include:
- runs_on: ubuntu-latest
feature: net-tokio,socket2
rust: stable
- runs_on: ubuntu-latest
feature: net-tokio,socket2
rust: beta
- runs_on: ubuntu-latest
feature: net-tokio,socket2
rust: 1.70.0 # MSRV
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
components: rustfmt,clippy
- name: build ch4
run: cargo build --no-default-features --features ${{ matrix.feature }}
- name: show ch4 info
if: ${{ !(matrix.feature == 'net-async-std' && matrix.runs_on == 'windows-latest') }}
env:
RUST_BACKTRACE: "full"
run: cargo run --no-default-features --features ${{ matrix.feature }} -- --info
- name: ch4 list nameservers
if: ${{ !(matrix.feature == 'net-async-std' && matrix.runs_on == 'windows-latest') }}
env:
RUST_BACKTRACE: "full"
run: cargo run --no-default-features --features ${{ matrix.feature }} -- --list-nameservers
- name: test ch4
run: cargo test --no-default-features --features ${{ matrix.feature }}
- name: lint ch4
run: cargo clippy --no-default-features --features ${{ matrix.feature }} -- -D warnings
no-rustfmt:
runs-on: ubuntu-latest
env:
RUSTFLAGS: --deny warnings
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- name: remove rustfmt
run: |
if which rustfmt; then
rm $(which rustfmt)
echo "remove-rustfmt: OK"
fi
if which rustfmt; then
echo "remove-rustfmt: VERIFY ERR"
exit 1
fi
shell: bash
- name: build without rustfmt
run: cargo build --all-targets
- name: test without rustfmt
run: cargo build --all-targets
- name: check without rustfmt
run: cargo check --all-targets
common-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
components: rustfmt
- name: format all
run: cargo fmt -- --check