| 1 | name: CI |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | pull_request: |
| 6 | branches: [main] |
| 7 | |
| 8 | jobs: |
| 9 | build: |
| 10 | runs-on: ubuntu-latest |
| 11 | continue-on-error: ${{ matrix.continue-on-error || false }} |
| 12 | |
| 13 | strategy: |
| 14 | matrix: |
| 15 | name: |
| 16 | - stable |
| 17 | - beta |
| 18 | - nightly |
| 19 | - "feat: no default features" |
| 20 | - "feat: all features" |
| 21 | |
| 22 | include: |
| 23 | - name: beta |
| 24 | rust: beta |
| 25 | - name: nightly |
| 26 | rust: nightly |
| 27 | continue-on-error: true |
| 28 | |
| 29 | - name: "feat: all features" |
| 30 | features: "--all-features" |
| 31 | |
| 32 | steps: |
| 33 | - uses: actions/checkout@v2 |
| 34 | - uses: hecrj/setup-rust-action@v1 |
| 35 | with: |
| 36 | rust-version: ${{ matrix.rust || 'stable' }} |
| 37 | |
| 38 | - name: Build |
| 39 | run: cargo build --verbose ${{ matrix.features }} |
| 40 | - name: Run tests |
| 41 | run: cargo test --verbose ${{ matrix.features }} -- --test-threads=1 |
| 42 | |
| 43 | pdfutil: |
| 44 | runs-on: ubuntu-latest |
| 45 | |
| 46 | steps: |
| 47 | - uses: actions/checkout@v2 |
| 48 | - uses: hecrj/setup-rust-action@v1 |
| 49 | |
| 50 | - name: Build |
| 51 | run: cargo build --verbose --manifest-path pdfutil/Cargo.toml |
| 52 | |
| 53 | clippy: |
| 54 | runs-on: ubuntu-latest |
| 55 | |
| 56 | steps: |
| 57 | - uses: actions/checkout@v2 |
| 58 | - uses: hecrj/setup-rust-action@v1 |
| 59 | |
| 60 | - name: clippy for lopdf |
| 61 | run: cargo clippy |
| 62 | - name: clippy for pdfutil |
| 63 | run: cargo clippy --manifest-path pdfutil/Cargo.toml |
| 64 | |
| 65 | wasm: |
| 66 | runs-on: ubuntu-latest |
| 67 | |
| 68 | steps: |
| 69 | - uses: actions/checkout@v2 |
| 70 | |
| 71 | - name: Install |
| 72 | run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh |
| 73 | |
| 74 | - run: cargo test |
| 75 | - run: RUSTFLAGS='--cfg getrandom_backend="wasm_js"' wasm-pack test --headless --chrome --features wasm_js |
| 76 | - run: RUSTFLAGS='--cfg getrandom_backend="wasm_js"' wasm-pack test --headless --firefox --features wasm_js |
| 77 | |
| 78 | wasi: |
| 79 | runs-on: ubuntu-latest |
| 80 | strategy: |
| 81 | matrix: |
| 82 | target: [wasm32-wasip1, wasm32-wasip2] |
| 83 | |
| 84 | steps: |
| 85 | - uses: actions/checkout@v2 |
| 86 | - uses: hecrj/setup-rust-action@v1 |
| 87 | with: |
| 88 | targets: ${{ matrix.target }} |
| 89 | |
| 90 | - name: Build |
| 91 | run: cargo build --verbose --target ${{ matrix.target }} |