async-profiler-agent 0.1.13

Rust agent for async-profiler
Documentation
name: Build
on: [pull_request]

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    strategy:
      matrix:
        toolchain:
          - "1.88" # Current MSRV due to 1.87 having problems with the AWS SDK
          - stable
          - nightly
        flags:
          - "--all-features"
          - "--no-default-features"
          - "--no-default-features --features=s3-no-defaults"
          - "--no-default-features --features=aws-metadata-no-defaults"
    env:
      RUST_BACKTRACE: 1
    steps:
      - uses: actions/checkout@v4
      - name: Build
        uses: ./.github/actions/rust-build
        with:
          toolchain: ${{ matrix.toolchain }}
          flags: ${{ matrix.flags }}
  build-for-testing:
    name: Build for testing
    runs-on: ubuntu-latest
    env:
      RUSTFLAGS: --cfg tokio_unstable
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@v2
      - name: Build
        shell: bash
        run: cargo build --all-features --verbose --example simple --example pollcatch-without-agent
      - name: Upload example-simple for testing
        uses: actions/upload-artifact@v4
        with:
          name: example-simple
          path: ./target/debug/examples/simple
      - name: Upload example-pollcatch-without-agent for testing
        uses: actions/upload-artifact@v4
        with:
          name: example-pollcatch-without-agent
          path: ./target/debug/examples/pollcatch-without-agent
  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:
          workspaces: 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-for-testing, build-decoder]
    steps:
      - uses: actions/checkout@v4
      - name: Download pollcatch-decoder
        uses: actions/download-artifact@v4
        with:
          name: pollcatch-decoder
          path: ./tests
      - name: Download example-simple
        uses: actions/download-artifact@v4
        with:
          name: example-simple
          path: ./tests
      - name: Download example-pollcatch-without-agent
        uses: actions/download-artifact@v4
        with:
          name: example-pollcatch-without-agent
          path: ./tests
      - name: Download async-profiler
        shell: bash
        working-directory: tests
        run: wget https://github.com/async-profiler/async-profiler/releases/download/v4.1/async-profiler-4.1-linux-x64.tar.gz -O async-profiler.tar.gz && tar xvf async-profiler.tar.gz && mv -vf async-profiler-*/lib/libasyncProfiler.so .
      - name: Run integration test
        shell: bash
        working-directory: tests
        # The `ls -l` is there to help debugging CI, I see no reason to remove it
        run: ls -l && chmod +x simple pollcatch-without-agent pollcatch-decoder && LD_LIBRARY_PATH=$PWD ./integration.sh && LD_LIBRARY_PATH=$PWD ./separate_runtime_integration.sh && LD_LIBRARY_PATH=$PWD ./test_pollcatch_without_agent.sh