feat: more tests and 3.14 #10
This file contains hidden or 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: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| rust-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: cargo test --lib | |
| python-tests: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ["3.9", "3.12", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: pip install maturin pytest | |
| - run: python tests/fixtures/create_fixtures.py | |
| - run: python tests/fixtures/create_edge_cases.py | |
| - name: Build and install | |
| run: | | |
| maturin build --features python --interpreter python | |
| pip install --find-links target/wheels fast_ebook | |
| - run: pytest tests/ -v --ignore=tests/test_epubcheck.py --ignore=tests/test_epubcheck_w3c.py --ignore=tests/test_w3c_conformance.py | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: cargo fmt --all --check | |
| - run: cargo clippy -p fast-ebook-cli -- -D warnings | |
| - run: cargo clippy -p fast-ebook --features python -- -D warnings | |
| epubcheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install EPUBCheck | |
| run: | | |
| EPUBCHECK_VERSION="5.1.0" | |
| curl -sL "https://github.com/w3c/epubcheck/releases/download/v${EPUBCHECK_VERSION}/epubcheck-${EPUBCHECK_VERSION}.zip" -o epubcheck.zip | |
| unzip -q epubcheck.zip | |
| echo "EPUBCHECK_JAR=$(pwd)/epubcheck-${EPUBCHECK_VERSION}/epubcheck.jar" >> $GITHUB_ENV | |
| - name: Build and install | |
| run: | | |
| pip install maturin pytest | |
| python tests/fixtures/create_fixtures.py | |
| python tests/fixtures/create_edge_cases.py | |
| maturin build --features python --interpreter python | |
| pip install --find-links target/wheels fast_ebook | |
| - name: Fetch W3C epub-tests corpus | |
| run: python tests/fetch_w3c_tests.py | |
| - name: Run EPUBCheck validation tests (bundled fixtures) | |
| run: pytest tests/test_epubcheck.py -v | |
| - name: Run EPUBCheck conformance tests (W3C corpus) | |
| run: pytest tests/test_epubcheck_w3c.py -v | |
| w3c-conformance: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Fetch W3C epub-tests fixtures | |
| run: python tests/fetch_w3c_tests.py | |
| - name: Build and install | |
| run: | | |
| pip install maturin pytest | |
| maturin build --features python --interpreter python | |
| pip install --find-links target/wheels fast_ebook | |
| - name: Run W3C parser conformance smoke test | |
| run: pytest tests/test_w3c_conformance.py -v | |
| cli: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: cargo build -p fast-ebook-cli --release | |
| - name: Test CLI | |
| run: | | |
| python tests/fixtures/create_fixtures.py | |
| ./target/release/fast-ebook --version | |
| ./target/release/fast-ebook info tests/fixtures/minimal_epub3.epub | |
| ./target/release/fast-ebook validate tests/fixtures/minimal_epub3.epub | |
| ./target/release/fast-ebook scan tests/fixtures/ | |
| ./target/release/fast-ebook convert tests/fixtures/minimal_epub3.epub -o /tmp/test.md | |
| test -s /tmp/test.md |