|
| 1 | +name: Lint and Test Code |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + paths: |
| 8 | + - src/** |
| 9 | + - Cargo.* |
| 10 | + - rust-toolchain.toml |
| 11 | + - .github/workflows/ci-code.yaml |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: read # Default token to read |
| 15 | + |
| 16 | +jobs: |
| 17 | + rustfmt: |
| 18 | + name: rustfmt |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - name: harden runner |
| 22 | + uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 |
| 23 | + with: |
| 24 | + egress-policy: audit |
| 25 | + |
| 26 | + - name: checkout repository |
| 27 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 28 | + with: |
| 29 | + submodules: recursive |
| 30 | + persist-credentials: false |
| 31 | + |
| 32 | + - name: Install llvm deps |
| 33 | + uses: ./.github/actions/install-llvm |
| 34 | + |
| 35 | + - name: 'cargo fmt' |
| 36 | + run: cargo fmt --all -- --check |
| 37 | + |
| 38 | + full-build: |
| 39 | + runs-on: ubuntu-latest |
| 40 | + strategy: |
| 41 | + fail-fast: false |
| 42 | + matrix: |
| 43 | + arch: |
| 44 | + - x86_64 |
| 45 | + env: |
| 46 | + TARGET_ARCH: "${{ matrix.arch }}" |
| 47 | + name: 'Full build linux-${{ matrix.arch }}' |
| 48 | + steps: |
| 49 | + - name: harden runner |
| 50 | + uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 |
| 51 | + with: |
| 52 | + egress-policy: audit |
| 53 | + |
| 54 | + - name: checkout repository |
| 55 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 56 | + with: |
| 57 | + submodules: recursive |
| 58 | + persist-credentials: false |
| 59 | + |
| 60 | + - name: Install llvm deps |
| 61 | + uses: ./.github/actions/install-llvm |
| 62 | + |
| 63 | + - name: cargo build |
| 64 | + run: cargo build |
| 65 | + |
| 66 | + clippy: |
| 67 | + runs-on: ubuntu-latest |
| 68 | + strategy: |
| 69 | + matrix: |
| 70 | + arch: |
| 71 | + - x86_64 |
| 72 | + env: |
| 73 | + TARGET_ARCH: "${{ matrix.arch }}" |
| 74 | + name: 'Full clippy linux-${{ matrix.arch }}' |
| 75 | + steps: |
| 76 | + - name: harden runner |
| 77 | + uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 |
| 78 | + with: |
| 79 | + egress-policy: audit |
| 80 | + |
| 81 | + - name: checkout repository |
| 82 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 83 | + with: |
| 84 | + submodules: recursive |
| 85 | + persist-credentials: false |
| 86 | + |
| 87 | + - name: Install llvm deps |
| 88 | + uses: ./.github/actions/install-llvm |
| 89 | + |
| 90 | + - name: 'cargo clippy' |
| 91 | + run: cargo clippy |
0 commit comments