Release version 0.4.0 #131
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 | |
env: | |
MSRV: '1.70' | |
jobs: | |
test: | |
name: Run tests on Rust ${{ matrix.toolchain }} (${{ matrix.os }}) | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: | |
- stable | |
- '1.70' # MSRV | |
- nightly | |
os: | |
- ubuntu | |
- macos | |
- windows | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust ${{ matrix.toolchain }} | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- name: Set up caching | |
uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo build --workspace --examples --verbose | |
- name: Run tests (unix) | |
if: matrix.os != 'windows' | |
run: ./scripts/faketty cargo test --workspace --verbose -- --exact --skip ui | |
- name: Run tests (Windows) | |
if: matrix.os == 'windows' | |
run: cargo test --workspace --verbose -- --exact --skip ui | |
- name: Run compile tests | |
if: matrix.toolchain != 'nightly' | |
run: cargo test --workspace --verbose ui -- --exact | |
- name: Run simple_example | |
run: cargo run --package argp --example simple_example two --fooey | |
- name: Report size overhead | |
if: matrix.os != 'windows' | |
run: ./scripts/report-size-overhead | |
lint: | |
name: Run linters | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust ${{ env.MSRV }} | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.MSRV }} | |
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 }} |