|
| 1 | +name: CI |
| 2 | +on: [push, pull_request] |
| 3 | + |
| 4 | +jobs: |
| 5 | + test: |
| 6 | + name: Test |
| 7 | + runs-on: ${{ matrix.os }} |
| 8 | + strategy: |
| 9 | + matrix: |
| 10 | + build: [stable, beta, nightly, linux32, macos, aarch64-ios, win32, win64, mingw32, mingw64, windows-2016] |
| 11 | + include: |
| 12 | + - build: stable |
| 13 | + os: ubuntu-latest |
| 14 | + rust: stable |
| 15 | + target: x86_64-unknown-linux-gnu |
| 16 | + - build: beta |
| 17 | + os: ubuntu-latest |
| 18 | + rust: beta |
| 19 | + target: x86_64-unknown-linux-gnu |
| 20 | + - build: nightly |
| 21 | + os: ubuntu-latest |
| 22 | + rust: nightly |
| 23 | + target: x86_64-unknown-linux-gnu |
| 24 | + - build: linux32 |
| 25 | + os: ubuntu-latest |
| 26 | + rust: stable |
| 27 | + target: i686-unknown-linux-gnu |
| 28 | + - build: macos |
| 29 | + os: macos-latest |
| 30 | + rust: stable |
| 31 | + target: x86_64-apple-darwin |
| 32 | + - build: aarch64-ios |
| 33 | + os: macos-latest |
| 34 | + rust: stable |
| 35 | + target: aarch64-apple-ios |
| 36 | + no_run: --no-run |
| 37 | + - build: win32 |
| 38 | + os: windows-2016 |
| 39 | + rust: stable-i686-msvc |
| 40 | + target: i686-pc-windows-msvc |
| 41 | + - build: win64 |
| 42 | + os: windows-latest |
| 43 | + rust: stable |
| 44 | + target: x86_64-pc-windows-msvc |
| 45 | + - build: mingw32 |
| 46 | + os: windows-latest |
| 47 | + rust: stable-i686-gnu |
| 48 | + target: i686-pc-windows-gnu |
| 49 | + - build: mingw64 |
| 50 | + os: windows-latest |
| 51 | + rust: stable-x86_64-gnu |
| 52 | + target: x86_64-pc-windows-gnu |
| 53 | + - build: windows-2016 |
| 54 | + os: windows-2016 |
| 55 | + rust: stable-x86_64 |
| 56 | + target: x86_64-pc-windows-msvc |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@master |
| 59 | + - name: Install Rust (rustup) |
| 60 | + run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} |
| 61 | + if: matrix.os != 'macos-latest' |
| 62 | + shell: bash |
| 63 | + - name: Install Rust (macos) |
| 64 | + run: | |
| 65 | + curl https://sh.rustup.rs | sh -s -- -y |
| 66 | + echo "##[add-path]$HOME/.cargo/bin" |
| 67 | + if: matrix.os == 'macos-latest' |
| 68 | + - run: rustup target add ${{ matrix.target }} |
| 69 | + - name: Install g++-multilib |
| 70 | + run: | |
| 71 | + set -e |
| 72 | + # Remove the ubuntu-toolchain-r/test PPA, which is added by default. |
| 73 | + # Some packages were removed, and this is causing the g++multilib |
| 74 | + # install to fail. Similar issue: |
| 75 | + # https://github.com/scikit-learn/scikit-learn/issues/13928. |
| 76 | + sudo add-apt-repository --remove ppa:ubuntu-toolchain-r/test |
| 77 | + sudo apt-get install g++-multilib |
| 78 | + if: matrix.build == 'linux32' |
| 79 | + - run: cargo build |
| 80 | + - run: cargo test ${{ matrix.no_run }} |
| 81 | + - run: cargo test ${{ matrix.no_run }} --features parallel |
| 82 | + - run: cargo test ${{ matrix.no_run }} --manifest-path cc-test/Cargo.toml --target ${{ matrix.target }} |
| 83 | + - run: cargo test ${{ matrix.no_run }} --manifest-path cc-test/Cargo.toml --target ${{ matrix.target }} --features parallel |
| 84 | + - run: cargo test ${{ matrix.no_run }} --manifest-path cc-test/Cargo.toml --target ${{ matrix.target }} --release |
| 85 | + |
| 86 | + msrv: |
| 87 | + name: MSRV |
| 88 | + runs-on: ${{ matrix.os }} |
| 89 | + strategy: |
| 90 | + matrix: |
| 91 | + os: [ubuntu-latest, windows-latest] |
| 92 | + steps: |
| 93 | + - uses: actions/checkout@master |
| 94 | + - name: Install Rust |
| 95 | + run: rustup update 1.31.0 --no-self-update && rustup default 1.31.0 |
| 96 | + shell: bash |
| 97 | + - run: cargo build |
| 98 | + |
| 99 | + rustfmt: |
| 100 | + name: Rustfmt |
| 101 | + runs-on: ubuntu-latest |
| 102 | + steps: |
| 103 | + - uses: actions/checkout@master |
| 104 | + - name: Install Rust |
| 105 | + run: rustup update stable && rustup default stable && rustup component add rustfmt |
| 106 | + - run: cargo fmt -- --check |
| 107 | + |
| 108 | + publish_docs: |
| 109 | + name: Publish Documentation |
| 110 | + runs-on: ubuntu-latest |
| 111 | + steps: |
| 112 | + - uses: actions/checkout@master |
| 113 | + - name: Install Rust |
| 114 | + run: rustup update stable && rustup default stable |
| 115 | + - name: Build documentation |
| 116 | + run: cargo doc --no-deps --all-features |
| 117 | + - name: Publish documentation |
| 118 | + run: | |
| 119 | + cd target/doc |
| 120 | + git init |
| 121 | + git add . |
| 122 | + git -c user.name='ci' -c user.email='ci' commit -m init |
| 123 | + git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages |
| 124 | + if: github.event_name == 'push' && github.event.ref == 'refs/heads/master' |
0 commit comments