|
| 1 | +name: "Check powerset" |
| 2 | + |
| 3 | +env: |
| 4 | + RUSTFLAGS: -Dwarnings |
| 5 | + |
| 6 | +concurrency: |
| 7 | + group: powerset-${{ github.head_ref }} |
| 8 | + cancel-in-progress: true |
| 9 | + |
| 10 | +on: |
| 11 | + schedule: |
| 12 | + - cron: "0 0 * * 1,5" # midnight on Monday, Friday |
| 13 | + push: |
| 14 | + tags: |
| 15 | + - "v[0-9]+.[0-9]+.[0-9]+" |
| 16 | + - "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+" |
| 17 | + - "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+" |
| 18 | + - "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+" |
| 19 | + workflow_dispatch: |
| 20 | + |
| 21 | +jobs: |
| 22 | + check-powerset: |
| 23 | + name: Type checking (${{ matrix.target.name }}) |
| 24 | + runs-on: ubuntu-latest |
| 25 | + strategy: |
| 26 | + fail-fast: false |
| 27 | + matrix: |
| 28 | + target: |
| 29 | + # All tier 1 platforms as of 2020-12-28 |
| 30 | + - { |
| 31 | + name: "ARM64 Linux", |
| 32 | + triple: aarch64-unknown-linux-gnu, |
| 33 | + has_std: true, |
| 34 | + } |
| 35 | + - { name: "32-bit MinGW", triple: i686-pc-windows-gnu, has_std: true } |
| 36 | + - { name: "32-bit MSVC", triple: i686-pc-windows-msvc, has_std: true } |
| 37 | + - { |
| 38 | + name: "32-bit Linux", |
| 39 | + triple: i686-unknown-linux-gnu, |
| 40 | + has_std: true, |
| 41 | + } |
| 42 | + - { name: "64-bit macOS", triple: x86_64-apple-darwin, has_std: true } |
| 43 | + - { |
| 44 | + name: "64-bit MinGW", |
| 45 | + triple: x86_64-pc-windows-gnu, |
| 46 | + has_std: true, |
| 47 | + } |
| 48 | + - { |
| 49 | + name: "64-bit MSVC", |
| 50 | + triple: x86_64-pc-windows-msvc, |
| 51 | + has_std: true, |
| 52 | + } |
| 53 | + - { |
| 54 | + name: "64-bit Linux", |
| 55 | + triple: x86_64-unknown-linux-gnu, |
| 56 | + has_std: true, |
| 57 | + } |
| 58 | + # Select tier 2 platforms as of 2020-12-28 |
| 59 | + - { name: "ARM64 Fuchsia", triple: aarch64-fuchsia, has_std: true } |
| 60 | + - { |
| 61 | + name: "ARM64 Android", |
| 62 | + triple: aarch64-linux-android, |
| 63 | + has_std: true, |
| 64 | + } |
| 65 | + - { |
| 66 | + name: "Bare Cortex", |
| 67 | + triple: thumbv7em-none-eabihf, |
| 68 | + has_std: false, |
| 69 | + } |
| 70 | + - { name: "WASI", triple: wasm32-wasi, has_std: true } |
| 71 | + - { name: "64-bit Fuchsia", triple: x86_64-fuchsia, has_std: true } |
| 72 | + - { |
| 73 | + name: "64-bit x86 Android", |
| 74 | + triple: x86_64-linux-android, |
| 75 | + has_std: true, |
| 76 | + } |
| 77 | + - { name: "NetBSD", triple: x86_64-unknown-netbsd, has_std: true } |
| 78 | + |
| 79 | + steps: |
| 80 | + - name: Checkout sources |
| 81 | + uses: actions/checkout@v2 |
| 82 | + |
| 83 | + - name: Install toolchain |
| 84 | + uses: actions-rs/toolchain@v1 |
| 85 | + with: |
| 86 | + profile: minimal |
| 87 | + toolchain: stable |
| 88 | + target: ${{ matrix.target.triple }} |
| 89 | + override: true |
| 90 | + |
| 91 | + - name: Install cargo-hack |
| 92 | + shell: bash |
| 93 | + run: | |
| 94 | + curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin |
| 95 | +
|
| 96 | + - name: Check feature powerset |
| 97 | + uses: actions-rs/cargo@v1 |
| 98 | + with: |
| 99 | + command: hack |
| 100 | + args: | |
| 101 | + check |
| 102 | + --no-dev-deps |
| 103 | + --version-range 1.51.. |
| 104 | + --clean-per-version |
| 105 | + --feature-powerset |
| 106 | + --optional-deps |
| 107 | + --exclude-features default,std,local-offset,quickcheck,quickcheck-dep,time-macros,formatting,itoa,serde-human-readable |
| 108 | + --exclude-all-features |
| 109 | + --target ${{ matrix.target.triple }} |
| 110 | + if: matrix.target.has_std == false |
| 111 | + |
| 112 | + - name: Check feature powerset |
| 113 | + uses: actions-rs/cargo@v1 |
| 114 | + with: |
| 115 | + command: hack |
| 116 | + args: | |
| 117 | + check |
| 118 | + --no-dev-deps |
| 119 | + --version-range 1.51.. |
| 120 | + --clean-per-version |
| 121 | + --feature-powerset |
| 122 | + --optional-deps |
| 123 | + --exclude-features default,quickcheck-dep,time-macros,itoa |
| 124 | + --target ${{ matrix.target.triple }} |
| 125 | + if: matrix.target.has_std == true |
| 126 | + |
| 127 | + release: |
| 128 | + name: Create release |
| 129 | + if: startsWith(${{ github.ref }}, 'refs/tags') |
| 130 | + needs: check-powerset |
| 131 | + runs-on: ubuntu-latest |
| 132 | + steps: |
| 133 | + - name: Checkout code |
| 134 | + uses: actions/checkout@v2 |
| 135 | + |
| 136 | + - name: Create release |
| 137 | + uses: actions/create-release@v1 |
| 138 | + env: |
| 139 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 140 | + with: |
| 141 | + tag_name: ${{ github.ref }} |
| 142 | + release_name: ${{ github.ref }} |
| 143 | + body: "" |
| 144 | + draft: false |
| 145 | + prerelease: | |
| 146 | + contains(${{ github.ref }}, 'alpha') |
| 147 | + || contains(${{ github.ref }}, 'beta') |
| 148 | + || contains(${{ github.ref }}, 'rc') |
0 commit comments