|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '0 0 1 * *' |
| 6 | + push: |
| 7 | + pull_request: |
| 8 | + |
| 9 | +jobs: |
| 10 | + rustfmt: |
| 11 | + strategy: |
| 12 | + fail-fast: false |
| 13 | + matrix: |
| 14 | + # Breaking changes like this might be mixed into the future stable versions. |
| 15 | + # https://github.com/rust-lang/rustfmt/pull/3632 |
| 16 | + channel: |
| 17 | + - 1.38.0 |
| 18 | + - stable |
| 19 | + |
| 20 | + name: Rustfmt (${{ matrix.channel }}) |
| 21 | + runs-on: ubuntu-18.04 |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Checkout |
| 25 | + uses: actions/checkout@v1 |
| 26 | + |
| 27 | + - name: rust-toolchain |
| 28 | + uses: actions-rs/toolchain@v1 |
| 29 | + with: |
| 30 | + toolchain: ${{ matrix.channel }}-x86_64-unknown-linux-gnu |
| 31 | + override: true |
| 32 | + profile: default |
| 33 | + |
| 34 | + - name: '`cargo fmt -- --check`' |
| 35 | + uses: actions-rs/cargo@v1 |
| 36 | + with: |
| 37 | + command: fmt |
| 38 | + args: --all -- --check |
| 39 | + |
| 40 | + build: |
| 41 | + strategy: |
| 42 | + fail-fast: false |
| 43 | + matrix: |
| 44 | + toolchain: |
| 45 | + # `x86_64-pc-windows-msvc` is tier 1 **for now**. |
| 46 | + - 1.38.0-x86_64-pc-windows-msvc |
| 47 | + - 1.38.0-x86_64-pc-windows-gnu |
| 48 | + - 1.38.0-x86_64-apple-darwin |
| 49 | + - 1.38.0-x86_64-unknown-linux-gnu |
| 50 | + - stable-x86_64-pc-windows-msvc |
| 51 | + - stable-x86_64-pc-windows-gnu |
| 52 | + - stable-x86_64-apple-darwin |
| 53 | + - stable-x86_64-unknown-linux-gnu |
| 54 | + - beta-x86_64-pc-windows-msvc |
| 55 | + - beta-x86_64-pc-windows-gnu |
| 56 | + - beta-x86_64-apple-darwin |
| 57 | + - beta-x86_64-unknown-linux-gnu |
| 58 | + include: |
| 59 | + - toolchain: 1.38.0-x86_64-pc-windows-msvc |
| 60 | + os: windows-latest |
| 61 | + - toolchain: 1.38.0-x86_64-pc-windows-gnu |
| 62 | + os: windows-latest |
| 63 | + - toolchain: 1.38.0-x86_64-apple-darwin |
| 64 | + os: macOS-latest |
| 65 | + - toolchain: 1.38.0-x86_64-unknown-linux-gnu |
| 66 | + os: ubuntu-18.04 |
| 67 | + - toolchain: stable-x86_64-pc-windows-msvc |
| 68 | + os: windows-latest |
| 69 | + - toolchain: stable-x86_64-pc-windows-gnu |
| 70 | + os: windows-latest |
| 71 | + - toolchain: stable-x86_64-apple-darwin |
| 72 | + os: macOS-latest |
| 73 | + - toolchain: stable-x86_64-unknown-linux-gnu |
| 74 | + os: ubuntu-18.04 |
| 75 | + - toolchain: beta-x86_64-pc-windows-msvc |
| 76 | + os: windows-latest |
| 77 | + - toolchain: beta-x86_64-pc-windows-gnu |
| 78 | + os: windows-latest |
| 79 | + - toolchain: beta-x86_64-apple-darwin |
| 80 | + os: macOS-latest |
| 81 | + - toolchain: beta-x86_64-unknown-linux-gnu |
| 82 | + os: ubuntu-18.04 |
| 83 | + |
| 84 | + name: ${{ matrix.toolchain }} |
| 85 | + runs-on: ${{ matrix.os }} |
| 86 | + |
| 87 | + steps: |
| 88 | + - name: '`git config --global core.autocrlf false`' |
| 89 | + run: git config --global core.autocrlf false |
| 90 | + if: matrix.os == 'windows-latest' |
| 91 | + |
| 92 | + - name: Checkout |
| 93 | + uses: actions/checkout@v1 |
| 94 | + |
| 95 | + - name: rust-toolchain |
| 96 | + uses: actions-rs/toolchain@v1 |
| 97 | + with: |
| 98 | + toolchain: ${{ matrix.toolchain }} |
| 99 | + override: true |
| 100 | + profile: default |
| 101 | + |
| 102 | + - name: Determine features |
| 103 | + id: features |
| 104 | + run: | |
| 105 | + if ${{ matrix.os == 'windows-latest' }}; then |
| 106 | + echo '::set-output name=features::--no-default-features' |
| 107 | + else |
| 108 | + echo '::set-output name=features::--all-features' |
| 109 | + fi |
| 110 | + shell: bash |
| 111 | + |
| 112 | + - name: '`cargo clippy`' |
| 113 | + uses: actions-rs/cargo@v1 |
| 114 | + with: |
| 115 | + command: clippy |
| 116 | + args: ${{ steps.features.outputs.features }} -- -D warnings |
| 117 | + |
| 118 | + - name: '`cargo test`' |
| 119 | + uses: actions-rs/cargo@v1 |
| 120 | + with: |
| 121 | + command: test |
| 122 | + args: ${{ steps.features.outputs.features }} --no-fail-fast |
| 123 | + |
| 124 | + - name: '`cargo run --release`' |
| 125 | + uses: actions-rs/cargo@v1 |
| 126 | + with: |
| 127 | + command: run |
| 128 | + args: ${{ steps.features.outputs.features }} --release |
0 commit comments