|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + rustfmt: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + steps: |
| 9 | + - uses: actions/checkout@v5 |
| 10 | + with: |
| 11 | + submodules: recursive |
| 12 | + |
| 13 | + - name: Install stable |
| 14 | + uses: dtolnay/rust-toolchain@stable |
| 15 | + with: |
| 16 | + components: rustfmt |
| 17 | + |
| 18 | + - name: Run rustfmt |
| 19 | + run: cargo fmt --all --check |
| 20 | + |
| 21 | + clippy: |
| 22 | + runs-on: ubuntu-latest |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v5 |
| 25 | + with: |
| 26 | + submodules: recursive |
| 27 | + |
| 28 | + - name: Install stable |
| 29 | + uses: dtolnay/rust-toolchain@stable |
| 30 | + with: |
| 31 | + components: clippy |
| 32 | + |
| 33 | + - name: Run clippy |
| 34 | + run: cargo clippy --all-features |
| 35 | + |
| 36 | + tests: |
| 37 | + strategy: |
| 38 | + matrix: |
| 39 | + conf: |
| 40 | + - tests |
| 41 | + - bench-resampler |
| 42 | + - bench-resampler-sse |
| 43 | + |
| 44 | + env: |
| 45 | + SPEEX_DIR: speex-dir |
| 46 | + |
| 47 | + runs-on: ubuntu-latest |
| 48 | + |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v5 |
| 51 | + with: |
| 52 | + submodules: recursive |
| 53 | + |
| 54 | + - name: Install speexdsp |
| 55 | + run: | |
| 56 | + git clone https://github.com/xiph/speexdsp.git |
| 57 | + cd speexdsp |
| 58 | + ./autogen.sh |
| 59 | + CONF=${{ matrix.conf }} |
| 60 | + if [ ${CONF} = "bench-resampler" ] |
| 61 | + then |
| 62 | + ./configure --disable-sse --prefix=$HOME/$SPEEX_DIR |
| 63 | + else |
| 64 | + ./configure --prefix=$HOME/$SPEEX_DIR |
| 65 | + fi |
| 66 | + make -j4 install |
| 67 | +
|
| 68 | + - name: Set environment variables |
| 69 | + run: | |
| 70 | + echo PKG_CONFIG_PATH="$HOME/$SPEEX_DIR/lib/pkgconfig" >> $GITHUB_ENV |
| 71 | + echo LD_LIBRARY_PATH="$HOME/$SPEEX_DIR/lib" >> $GITHUB_ENV |
| 72 | +
|
| 73 | + - name: Install stable |
| 74 | + uses: dtolnay/rust-toolchain@stable |
| 75 | + |
| 76 | + - name: Run benchmark |
| 77 | + if: matrix.conf != 'tests' |
| 78 | + run: | |
| 79 | + cargo bench -q --features sys -- resampler_c |
| 80 | + cargo bench -q -- resampler_rust |
| 81 | +
|
| 82 | + - name: Run no-default-features tests |
| 83 | + if: matrix.conf == 'tests' |
| 84 | + run: | |
| 85 | + cargo test --all --no-default-features |
| 86 | +
|
| 87 | + - name: Run all-features tests |
| 88 | + if: matrix.conf == 'tests' |
| 89 | + run: | |
| 90 | + cargo test --all --features "sse3 avx dynnative" |
0 commit comments