Build also with --no-default-features in report-size-overhead #112
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
- push | |
- pull_request | |
jobs: | |
test: | |
name: Run tests on Rust ${{ matrix.toolchain }} (${{ matrix.os }}) | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: | |
- stable | |
- '1.56' | |
- nightly | |
os: | |
- ubuntu | |
- macos | |
- windows | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust stable | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- name: Install cargo-hack | |
uses: taiki-e/install-action@cargo-hack | |
- name: Set up caching | |
uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo build -v --workspace --examples | |
- name: Run tests (unix) | |
if: matrix.os != 'windows' | |
run: ./scripts/faketty cargo hack test -v --workspace --each-feature -- --exact --skip ui | |
- name: Run tests (Windows) | |
if: matrix.os == 'windows' | |
run: cargo hack test -v --workspace --each-feature -- --exact --skip ui | |
- name: Run compile tests | |
if: matrix.toolchain != 'nightly' | |
run: cargo test --workspace --verbose ui -- --exact | |
- name: Run subcommands example | |
run: cargo run --package argp --example subcommands two --fooey | |
- name: Report size overhead | |
# 1.56 doesn't support -C strip. | |
if: matrix.os != 'windows' && matrix.toolchain != '1.56' | |
run: ./scripts/report-size-overhead | |
lint: | |
name: Run linters | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
- name: Set up caching | |
uses: Swatinem/rust-cache@v2 | |
- name: Run clippy | |
run: cargo clippy --version && cargo clippy --tests --workspace -- -D warnings | |
- name: Run Rustfmt | |
run: cargo fmt -- --check | |
- name: Check documentation | |
run: cargo doc --no-deps --document-private-items --workspace | |
env: | |
RUSTDOCFLAGS: -D warnings | |
publish: | |
name: Publish to crates.io | |
needs: | |
- test | |
- lint | |
if: startsWith(github.ref, 'refs/tags/v') && github.event_name != 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install asciidoctor and pandoc | |
run: sudo apt-get install asciidoctor pandoc | |
- name: Convert README to Markdown | |
run: | | |
printf '# Argp\n\n' > README.md | |
asciidoctor -b docbook -o - README.adoc \ | |
| pandoc -f docbook -t gfm --wrap=preserve --shift-heading-level-by=1 \ | |
| tee -a argp/README.md argp_derive/README.md | |
- name: Publish to crates.io | |
run: | | |
cargo publish -p argp_derive --locked --verbose | |
cargo publish -p argp --locked --verbose | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |