ci: add integration tests #1
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: Build | ||
| on: [pull_request] | ||
| jobs: | ||
| build: | ||
| name: Build | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| toolchain: | ||
| - stable # Stable is first to test with Cargo.lock | ||
| - "1.85" # Current MSRV due to Cargo MSRV feature | ||
| env: | ||
| RUST_BACKTRACE: 1 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Build | ||
| uses: ./.github/actions/rust-build | ||
| with: | ||
| toolchain: ${{ matrix.toolchain }} | ||
| - name: Upload artifact for testing | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: example-simple | ||
| path: ./target/debug/example/simple | ||
| build-decoder: | ||
| name: Build Decoder | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| RUST_BACKTRACE: 1 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dtolnay/rust-toolchain@master | ||
| with: | ||
| toolchain: stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| cache-directories: decoder | ||
| - name: Build | ||
| working-directory: decoder | ||
| shell: bash | ||
| run: cargo build --all-features --verbose | ||
| - name: Run tests | ||
| working-directory: decoder | ||
| shell: bash | ||
| run: cargo test --all-features --verbose | ||
| - name: Upload artifact for testing | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: pollcatch-decoder | ||
| path: ./decoder/target/debug/pollcatch-decoder | ||
| test: | ||
| name: Integration test | ||
| runs-on: ubuntu-latest | ||
| needs: build | ||
| needs: build-decoder | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install async-profiler Dependencies | ||
| run: sudo apt-get install -y sudo libicu-dev patchelf curl make g++ openjdk-11-jdk-headless gcovr | ||
| - name: Download pollcatch-decoder | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: pollcatch-decoder | ||
| path: ./tests/pollcatch-decoder | ||
| - name: Download example-simple | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: example-simple | ||
| path: ./tests/example-simple | ||
| - name: Run integration test | ||
| shell: bash | ||
| working-directory: tests | ||
| run: ./integration.sh | ||