Skip to content

parse-zoneinfo: replace rule parser with simple state machine #332

parse-zoneinfo: replace rule parser with simple state machine

parse-zoneinfo: replace rule parser with simple state machine #332

Workflow file for this run

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
- name: Verify cargo publish includes all files needed to build
run: |
cargo vendor
cargo package -p chrono-tz-build
cargo package -p chrono-tz --no-verify
for crate in target/package/*.crate
do
name=$(basename "$crate" .crate)
tar xvfz "$crate" -C vendor/
# Crates in the vendor directory require a checksum file, but it
# doesn't matter if it is empty.
echo '{"files":{}}' > vendor/$name/.cargo-checksum.json
done
cargo package --config "source.vendored-sources.directory = 'vendor'" \
--config "source.crates-io.replace-with = 'vendored-sources'"
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