|
34 | 34 | uses: ./.github/workflows/checks.yml
|
35 | 35 |
|
36 | 36 | build:
|
37 |
| - name: Build & Test |
| 37 | + name: ${{ matrix.platform }} |
38 | 38 | needs: [initialize, checks]
|
39 |
| - uses: ./.github/workflows/build.yml |
40 |
| - with: |
41 |
| - ref: ${{ needs.init.outputs.ref }} |
| 39 | + runs-on: ${{ matrix.os }} |
| 40 | + strategy: |
| 41 | + fail-fast: false |
| 42 | + matrix: |
| 43 | + platform: |
| 44 | + - linux-x64 |
| 45 | + - macos-arm64 |
| 46 | + - macos-x64 |
| 47 | + #- windows-x64 |
| 48 | + |
| 49 | + include: |
| 50 | + - platform: linux-x64 |
| 51 | + os: ubuntu-22.04 |
| 52 | + - platform: macos-arm64 |
| 53 | + os: macos-14 |
| 54 | + - platform: macos-x64 |
| 55 | + os: macos-13 |
| 56 | + #- platform: windows-x64 |
| 57 | + # os: windows-2022 |
| 58 | + |
| 59 | + steps: |
| 60 | + - name: Checkout source code |
| 61 | + uses: actions/checkout@v4 |
| 62 | + with: |
| 63 | + ref: ${{ github.ref }} |
| 64 | + |
| 65 | + - name: Install Rust |
| 66 | + uses: dtolnay/rust-toolchain@master |
| 67 | + with: |
| 68 | + components: 'llvm-tools-preview' |
| 69 | + toolchain: stable |
| 70 | + |
| 71 | + - name: Install grcov |
| 72 | + uses: taiki-e/install-action@main |
| 73 | + with: |
| 74 | + tool: grcov |
| 75 | + |
| 76 | + - name: Enable caching |
| 77 | + uses: Swatinem/rust-cache@v2 |
| 78 | + |
| 79 | + - name: Tests |
| 80 | + env: |
| 81 | + CARGO_TERM_COLOR: always |
| 82 | + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 83 | + LLVM_PROFILE_FILE: postgresql-%p-%m.profraw |
| 84 | + RUST_LOG: "info,postgresql_archive=debug,postgresql_embedded=debug" |
| 85 | + RUST_LOG_SPAN_EVENTS: full |
| 86 | + RUSTFLAGS: -Cinstrument-coverage |
| 87 | + RUSTDOCFLAGS: -Cinstrument-coverage |
| 88 | + run: | |
| 89 | + cargo test --workspace --all-features |
| 90 | +
|
| 91 | + - name: Produce coverage info |
| 92 | + if: ${{ startsWith(matrix.os, 'ubuntu-') }} |
| 93 | + run: | |
| 94 | + grcov $(find . -name "postgresql-*.profraw" -print) \ |
| 95 | + -s . \ |
| 96 | + --branch \ |
| 97 | + --ignore-not-existing \ |
| 98 | + --ignore='target/*' \ |
| 99 | + --ignore='benches/*' \ |
| 100 | + --ignore='/*' \ |
| 101 | + --binary-path ./target/debug/ \ |
| 102 | + --excl-line='#\[derive' \ |
| 103 | + -t lcov \ |
| 104 | + -o lcov.info |
| 105 | +
|
| 106 | + - name: Upload to codecov.io |
| 107 | + if: ${{ startsWith(matrix.os, 'ubuntu-') }} |
| 108 | + uses: codecov/codecov-action@v3 |
| 109 | + with: |
| 110 | + files: lcov.info |
| 111 | + fail_ci_if_error: true |
| 112 | + |
| 113 | + - name: Install benchmarking tools |
| 114 | + if: ${{ startsWith(matrix.os, 'ubuntu-') }} |
| 115 | + uses: bencherdev/bencher@main |
| 116 | + |
| 117 | + - name: Run benchmarks |
| 118 | + if: ${{ startsWith(matrix.os, 'ubuntu-') }} |
| 119 | + env: |
| 120 | + BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} |
| 121 | + BENCHER_PROJECT: theseus-rs-postgresql-embedded |
| 122 | + BENCHER_ADAPTER: rust_criterion |
| 123 | + run: | |
| 124 | + cargo bench --bench archive --features blocking -- --output-format criterion | \ |
| 125 | + bencher run |
| 126 | + cargo bench --bench embedded --features blocking -- --output-format criterion | \ |
| 127 | + bencher run |
0 commit comments