|
| 1 | +name: rust-test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 'main' |
| 7 | + - 'branch-*' |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - "*" |
| 11 | + |
| 12 | +jobs: |
| 13 | + format: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - uses: dtolnay/rust-toolchain@master |
| 19 | + with: |
| 20 | + toolchain: stable |
| 21 | + |
| 22 | + - name: Format |
| 23 | + run: cargo fmt -- --check |
| 24 | + |
| 25 | + build: |
| 26 | + strategy: |
| 27 | + fail-fast: false |
| 28 | + matrix: |
| 29 | + os: |
| 30 | + - ubuntu-latest |
| 31 | + # - macos-11 |
| 32 | + # - windows-latest |
| 33 | + runs-on: ${{ matrix.os }} |
| 34 | + |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + |
| 38 | + - uses: dtolnay/rust-toolchain@master |
| 39 | + with: |
| 40 | + toolchain: stable |
| 41 | + |
| 42 | + - uses: Swatinem/rust-cache@v2 |
| 43 | + |
| 44 | + - name: Install native libs |
| 45 | + run: sudo apt-get install -y libkrb5-dev |
| 46 | + |
| 47 | + - name: build and lint with clippy |
| 48 | + run: cargo clippy --all-targets --features kerberos,integration-test -- -D warnings |
| 49 | + |
| 50 | + - name: Check docs |
| 51 | + run: cargo doc |
| 52 | + |
| 53 | + - name: Check all features |
| 54 | + run: cargo check --all-targets --features kerberos,integration-test |
| 55 | + |
| 56 | + test: |
| 57 | + strategy: |
| 58 | + fail-fast: false |
| 59 | + matrix: |
| 60 | + os: |
| 61 | + - ubuntu-latest |
| 62 | + # - macos-11 |
| 63 | + # - windows-latest |
| 64 | + runs-on: ${{ matrix.os }} |
| 65 | + env: |
| 66 | + # Disable full debug symbol generation to speed up CI build and keep memory down |
| 67 | + # "1" means line tables only, which is useful for panic tracebacks. |
| 68 | + RUSTFLAGS: -C debuginfo=1 |
| 69 | + RUST_BACKTRACE: "1" |
| 70 | + RUST_LOG: debug |
| 71 | + |
| 72 | + steps: |
| 73 | + - uses: actions/checkout@v4 |
| 74 | + |
| 75 | + - name: Install minimal stable with clippy and rustfmt |
| 76 | + uses: dtolnay/rust-toolchain@master |
| 77 | + with: |
| 78 | + toolchain: stable |
| 79 | + |
| 80 | + - uses: Swatinem/rust-cache@v2 |
| 81 | + |
| 82 | + - uses: actions/setup-java@v3 |
| 83 | + with: |
| 84 | + distribution: "temurin" |
| 85 | + java-version: "17" |
| 86 | + |
| 87 | + - name: Install native libs |
| 88 | + run: sudo apt-get install -y libkrb5-dev krb5-user |
| 89 | + |
| 90 | + - name: Download Hadoop |
| 91 | + run: | |
| 92 | + wget -q https://dlcdn.apache.org/hadoop/common/hadoop-3.4.0/hadoop-3.4.0.tar.gz |
| 93 | + tar -xf hadoop-3.4.0.tar.gz -C $GITHUB_WORKSPACE |
| 94 | + echo "$GITHUB_WORKSPACE/hadoop-3.4.0/bin" >> $GITHUB_PATH |
| 95 | +
|
| 96 | + - name: Run tests |
| 97 | + run: cargo test --features kerberos,integration-test |
0 commit comments