microsoft/qdk
Publicmirrored fromhttps://github.com/microsoft/qdkAvailable
.github/workflows/ci.yml
105lines · modecode
| 1 | name: CI Build and Test |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: [main] |
| 6 | pull_request: |
| 7 | branches: [main] |
| 8 | workflow_dispatch: |
| 9 | |
| 10 | env: |
| 11 | CARGO_TERM_COLOR: always |
| 12 | RUST_TOOLCHAIN_VERSION: 1.69 |
| 13 | RUST_TOOLCHAIN_COMPONENTS: rustfmt clippy |
| 14 | |
| 15 | jobs: |
| 16 | format: |
| 17 | name: Format |
| 18 | runs-on: ubuntu-latest |
| 19 | steps: |
| 20 | - uses: actions/checkout@v3 |
| 21 | with: |
| 22 | submodules: "true" |
| 23 | - name: Setup rust toolchain |
| 24 | uses: ./.github/actions/toolchains/rust |
| 25 | with: |
| 26 | toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }} |
| 27 | components: ${{ env.RUST_TOOLCHAIN_COMPONENTS }} |
| 28 | - name: Check Formatting |
| 29 | run: cargo fmt --all -- --check |
| 30 | |
| 31 | clippy: |
| 32 | name: Clippy |
| 33 | runs-on: ubuntu-latest |
| 34 | steps: |
| 35 | - uses: actions/checkout@v3 |
| 36 | with: |
| 37 | submodules: "true" |
| 38 | - name: Setup rust toolchain |
| 39 | uses: ./.github/actions/toolchains/rust |
| 40 | with: |
| 41 | toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }} |
| 42 | components: ${{ env.RUST_TOOLCHAIN_COMPONENTS }} |
| 43 | - uses: Swatinem/rust-cache@v2 |
| 44 | - name: Clippy Lints |
| 45 | run: cargo clippy --all-targets --all-features -- -D warnings |
| 46 | |
| 47 | benches: |
| 48 | name: Benches |
| 49 | runs-on: ubuntu-latest |
| 50 | steps: |
| 51 | - uses: actions/checkout@v3 |
| 52 | with: |
| 53 | submodules: "true" |
| 54 | - name: Setup rust toolchain |
| 55 | uses: ./.github/actions/toolchains/rust |
| 56 | with: |
| 57 | toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }} |
| 58 | components: ${{ env.RUST_TOOLCHAIN_COMPONENTS }} |
| 59 | - uses: Swatinem/rust-cache@v2 |
| 60 | - name: cargo bench |
| 61 | run: cargo bench --workspace |
| 62 | |
| 63 | web-check: |
| 64 | name: Check web files |
| 65 | runs-on: ubuntu-latest |
| 66 | steps: |
| 67 | - uses: actions/checkout@v3 |
| 68 | with: |
| 69 | submodules: "true" |
| 70 | - uses: actions/setup-node@v3 |
| 71 | with: |
| 72 | node-version: '16.17.1' |
| 73 | - name: npm install |
| 74 | run: npm install |
| 75 | - name: npm check |
| 76 | run: npm run check |
| 77 | |
| 78 | build: |
| 79 | name: CI Build and Test |
| 80 | strategy: |
| 81 | matrix: |
| 82 | os: [windows-latest, ubuntu-latest, macos-latest] |
| 83 | |
| 84 | runs-on: ${{matrix.os}} |
| 85 | |
| 86 | steps: |
| 87 | - uses: actions/checkout@v3 |
| 88 | with: |
| 89 | submodules: "true" |
| 90 | - name: Setup rust toolchain |
| 91 | uses: ./.github/actions/toolchains/rust |
| 92 | with: |
| 93 | toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }} |
| 94 | components: ${{ env.RUST_TOOLCHAIN_COMPONENTS }} |
| 95 | - uses: actions/setup-python@v4 |
| 96 | with: |
| 97 | python-version: '3.11' |
| 98 | - uses: actions/setup-node@v3 |
| 99 | with: |
| 100 | node-version: '16.17.1' |
| 101 | - uses: Swatinem/rust-cache@v2 |
| 102 | - name: Prereqs |
| 103 | run: python ./prereqs.py --install |
| 104 | - name: Build and Test |
| 105 | run: python ./build.py --no-check |
| 106 | |