Document features when compiled for docs.rs #246
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: Rust | |
on: | |
push: | |
branches: [ main, 'update-tz*' ] | |
pull_request: | |
branches: [ '*' ] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, ubuntu-20.04, macos-latest] | |
include: | |
- os: ubuntu-latest | |
run_no_std: true | |
run_lint: true | |
runs-on: ${{ matrix.os }} | |
env: | |
RUST_BACKTRACE: 1 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Checkout submodules | |
shell: bash | |
run: | | |
auth_header="$(git config --local --get http.https://github.com/.extraheader)" | |
git submodule sync --recursive | |
git -c "http.extraheader=$auth_header" -c protocol.version=2 \ | |
submodule update --init --force --recursive --depth=1 | |
- name: Run tests | |
run: cargo test --color=always -- --color=always | |
- name: Run tests with all features | |
run: cargo test --all-features --color=always -- --color=always | |
- name: Run regex tests | |
run: bin/test-regex-filtering.sh | |
- name: Check with no default features | |
run: cargo check --no-default-features --color=always | |
- name: Install no_std toolchain | |
if: ${{ matrix.run_no_std }} | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
target: thumbv7m-none-eabi | |
- name: Verify builds on no_std no features | |
if: ${{ matrix.run_no_std }} | |
working-directory: chrono-tz/tests/check-nostd | |
run: | | |
cargo clean | |
cargo build --no-default-features | |
- name: Verify builds on no_std with serde | |
if: ${{ matrix.run_no_std }} | |
working-directory: chrono-tz/tests/check-nostd | |
run: | | |
cargo clean | |
cargo build --features serde1 | |
- name: Verify builds on no_std case-insensitive | |
if: ${{ matrix.run_no_std }} | |
working-directory: chrono-tz/tests/check-nostd | |
run: | | |
cargo clean | |
cargo build --features case-insensitive | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Checkout submodules | |
shell: bash | |
run: | | |
auth_header="$(git config --local --get http.https://github.com/.extraheader)" | |
git submodule sync --recursive | |
git -c "http.extraheader=$auth_header" -c protocol.version=2 \ | |
submodule update --init --force --recursive --depth=1 | |
- name: clippy | |
run: cargo clippy --color=always | |
- name: rustfmt | |
run: cargo fmt -- --color=always --check | |
# chrono-tz-build | |
- name: clippy chrono-tz-build | |
working-directory: ./chrono-tz-build | |
run: cargo clippy --color=always | |
- name: clippy chrono-tz-build all features | |
working-directory: ./chrono-tz-build | |
run: cargo clippy --all-features --color=always | |
- name: rustfmt | |
working-directory: ./chrono-tz-build | |
run: cargo fmt -- --color=always --check |