|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: [pull_request, push] |
| 4 | + |
| 5 | +jobs: |
| 6 | + ################################################### |
| 7 | + # Formatting |
| 8 | + ################################################### |
| 9 | + |
| 10 | + format: |
| 11 | + name: Check formatting |
| 12 | + |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + steps: |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@v2 |
| 18 | + |
| 19 | + - name: Install rust |
| 20 | + uses: actions-rs/toolchain@v1 |
| 21 | + with: |
| 22 | + toolchain: stable |
| 23 | + components: rustfmt |
| 24 | + profile: minimal |
| 25 | + override: true |
| 26 | + |
| 27 | + - name: Run rustfmt |
| 28 | + uses: actions-rs/cargo@v1 |
| 29 | + with: |
| 30 | + command: fmt |
| 31 | + args: -- --check |
| 32 | + |
| 33 | + ################################################### |
| 34 | + # Main Builds |
| 35 | + ################################################### |
| 36 | + |
| 37 | + build: |
| 38 | + runs-on: ${{ matrix.os }} |
| 39 | + |
| 40 | + strategy: |
| 41 | + fail-fast: false |
| 42 | + matrix: |
| 43 | + rust: [stable, beta, nightly] |
| 44 | + os: [ubuntu-latest, windows-latest, macOS-latest] |
| 45 | + |
| 46 | + steps: |
| 47 | + - name: Checkout |
| 48 | + uses: actions/checkout@v2 |
| 49 | + |
| 50 | + - name: Install rust |
| 51 | + uses: actions-rs/toolchain@v1 |
| 52 | + with: |
| 53 | + toolchain: ${{ matrix.rust }} |
| 54 | + profile: minimal |
| 55 | + override: true |
| 56 | + |
| 57 | + - name: Install cargo-make (Linux) |
| 58 | + if: runner.os == 'Linux' |
| 59 | + run: | |
| 60 | + _build/cargo-make.sh "0.20.0" "x86_64-unknown-linux-musl" |
| 61 | +
|
| 62 | + - name: Install cargo-make (macOS) |
| 63 | + if: runner.os == 'macOS' |
| 64 | + run: | |
| 65 | + _build/cargo-make.sh "0.20.0" "x86_64-apple-darwin" |
| 66 | +
|
| 67 | + - name: Install cargo-make (Windows) |
| 68 | + if: runner.os == 'Windows' |
| 69 | + run: | |
| 70 | + _build\cargo-make.ps1 -version "0.20.0" -target "x86_64-pc-windows-msvc" |
| 71 | +
|
| 72 | + - name: Build and run tests |
| 73 | + env: |
| 74 | + RUSTFLAGS: "-C link-dead-code" |
| 75 | + CARGO_MAKE_RUN_CODECOV: true |
| 76 | + run: | |
| 77 | + cargo make workspace-ci-flow --no-workspace |
| 78 | +
|
| 79 | + ################################################### |
| 80 | + # WASM Builds |
| 81 | + ################################################### |
| 82 | + |
| 83 | + wasm: |
| 84 | + runs-on: ${{ matrix.os }} |
| 85 | + |
| 86 | + strategy: |
| 87 | + matrix: |
| 88 | + os: [ubuntu-latest, windows-latest, macOS-latest] |
| 89 | + |
| 90 | + steps: |
| 91 | + - name: Checkout |
| 92 | + uses: actions/checkout@v2 |
| 93 | + |
| 94 | + - name: Install rust |
| 95 | + uses: actions-rs/toolchain@v1 |
| 96 | + with: |
| 97 | + toolchain: stable |
| 98 | + target: wasm32-unknown-unknown |
| 99 | + profile: minimal |
| 100 | + override: true |
| 101 | + |
| 102 | + - name: Check |
| 103 | + uses: actions-rs/cargo@v1 |
| 104 | + with: |
| 105 | + command: check |
| 106 | + args: --target wasm32-unknown-unknown --package juniper --package juniper_codegen |
| 107 | + |
| 108 | + ################################################### |
| 109 | + # Releases |
| 110 | + ################################################### |
| 111 | + |
| 112 | + release: |
| 113 | + name: Check release automation |
| 114 | + |
| 115 | + runs-on: ubuntu-latest |
| 116 | + |
| 117 | + steps: |
| 118 | + - name: Checkout |
| 119 | + uses: actions/checkout@v2 |
| 120 | + with: |
| 121 | + fetch-depth: 20 |
| 122 | + |
| 123 | + - name: Install rust |
| 124 | + uses: actions-rs/toolchain@v1 |
| 125 | + with: |
| 126 | + toolchain: stable |
| 127 | + profile: minimal |
| 128 | + override: true |
| 129 | + |
| 130 | + - name: Install cargo-make |
| 131 | + run: | |
| 132 | + _build/cargo-make.sh "0.20.0" "x86_64-unknown-linux-musl" |
| 133 | +
|
| 134 | + - name: Install cargo-release |
| 135 | + uses: actions-rs/cargo@v1 |
| 136 | + with: |
| 137 | + command: install |
| 138 | + args: --version=0.11.2 cargo-release |
| 139 | + |
| 140 | + - name: Setup git |
| 141 | + run: | |
| 142 | + git config --global user.email "[email protected]" |
| 143 | + git config --global user.name "Release Test Bot" |
| 144 | +
|
| 145 | + - name: Dry run mode |
| 146 | + env: |
| 147 | + RELEASE_LEVEL: minor |
| 148 | + run: | |
| 149 | + cargo make release-dry-run |
| 150 | +
|
| 151 | + - name: Local test mode |
| 152 | + env: |
| 153 | + RELEASE_LEVEL: minor |
| 154 | + run: | |
| 155 | + cargo make release-local-test |
| 156 | +
|
| 157 | + - name: Echo local changes |
| 158 | + run: | |
| 159 | + git --no-pager log -p HEAD...HEAD~20 |
| 160 | +
|
| 161 | + - name: Run tests |
| 162 | + run: | |
| 163 | + cargo make workspace-ci-flow --no-workspace |
0 commit comments