|
| 1 | +name: Rust |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 'master' |
| 7 | + - '!gh-pages' |
| 8 | + pull_request: |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + runs-on: windows-latest |
| 13 | + env: |
| 14 | + # RUSTFLAGS: -Ctarget-feature=+crt-static |
| 15 | + RUST_BACKTRACE: 1 |
| 16 | + MINGW_URL: https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + target: [x86_64-pc-windows-msvc, i686-pc-windows-msvc, x86_64-pc-windows-gnu, i686-pc-windows-gnu] |
| 20 | + include: |
| 21 | + - target: x86_64-pc-windows-gnu |
| 22 | + archive: x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z |
| 23 | + mingw_dir: mingw64 |
| 24 | + - target: i686-pc-windows-gnu |
| 25 | + archive: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z |
| 26 | + mingw_dir: mingw32 |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v1 |
| 29 | + with: |
| 30 | + fetch-depth: 1 |
| 31 | + - name: Install Rust |
| 32 | + run: | |
| 33 | + curl -sSL https://sh.rustup.rs | sh -s -- -y --default-toolchain=stable --profile=minimal |
| 34 | + echo "##[add-path]$HOME/.cargo/bin" |
| 35 | + export PATH="$PATH:$HOME/.cargo/bin" |
| 36 | + rustup update --no-self-update stable |
| 37 | + shell: bash |
| 38 | + - name: Check out MinGW toolchain |
| 39 | + run: | |
| 40 | + set -ex |
| 41 | + curl -sSf -O "${MINGW_URL}/${{ matrix.archive }}" |
| 42 | + 7z x -y "${{ matrix.archive }}" -o/c/mingw |
| 43 | + rm "${{ matrix.archive }}" |
| 44 | + set +ex |
| 45 | + echo "##[add-path]C:\mingw\${{ matrix.mingw_dir }}\bin" |
| 46 | + shell: bash |
| 47 | + if: matrix.mingw_dir |
| 48 | + - run: rustup target add ${{ matrix.target }} |
| 49 | + - run: cargo fetch |
| 50 | + - run: cargo build --target ${{ matrix.target }} |
| 51 | + - run: cargo test --target ${{ matrix.target }} |
| 52 | + - if: failure() |
| 53 | + run: | |
| 54 | + Set-PSDebug -Trace 1 |
| 55 | + Get-ChildItem -Path target\${{ matrix.target }}\debug\junction-test-*\ | Select-Object FullName, Target |
| 56 | + Get-ChildItem -Path target\${{ matrix.target }}\debug\junction-test-*\junction | Select-Object FullName, Target |
| 57 | + shell: powershell |
| 58 | + - if: failure() |
| 59 | + run: | |
| 60 | + dir /aL C:\ |
| 61 | + dir /aL C:\Users |
| 62 | + shell: cmd |
| 63 | + |
| 64 | + rustdoc: |
| 65 | + runs-on: windows-latest |
| 66 | + if: github.event_name != 'pull_request' && github.head_ref == 'refs/heads/master' |
| 67 | + steps: |
| 68 | + - uses: actions/checkout@v1 |
| 69 | + with: |
| 70 | + fetch-depth: 1 |
| 71 | + - name: Install Rust |
| 72 | + run: | |
| 73 | + curl -sSL https://sh.rustup.rs | sh -s -- -y --default-toolchain=stable --profile=minimal -c rustfmt |
| 74 | + echo "##[add-path]$HOME/.cargo/bin" |
| 75 | + export PATH="$PATH:$HOME/.cargo/bin" |
| 76 | + rustup update --no-self-update stable |
| 77 | + shell: bash |
| 78 | + - run: cargo doc --all --no-deps # --document-private-items |
| 79 | + - run: echo '<meta http-equiv=refresh content=0;url=junction/index.html>' > target/doc/index.html |
| 80 | + - run: sh ./ci/ghpages-deploy.sh |
| 81 | + shell: bash |
| 82 | + env: |
| 83 | + ENCRYPTED_KEY: ${{ secrets.ENCRYPTED_KEY }} |
| 84 | + ENCRYPTED_IV: ${{ secrets.ENCRYPTED_IV }} |
| 85 | + |
| 86 | + |
| 87 | + rustfmt: |
| 88 | + runs-on: ubuntu-latest |
| 89 | + steps: |
| 90 | + - uses: actions/checkout@v1 |
| 91 | + with: |
| 92 | + fetch-depth: 1 |
| 93 | + - run: | |
| 94 | + rustup self update |
| 95 | + rustup set profile minimal |
| 96 | + rustup update --no-self-update stable |
| 97 | + rustup component add rustfmt |
| 98 | + - run: cargo fmt --all -- --check |
| 99 | + |
| 100 | + clippy: |
| 101 | + runs-on: windows-latest |
| 102 | + needs: [build] |
| 103 | + steps: |
| 104 | + - uses: actions/checkout@v1 |
| 105 | + with: |
| 106 | + fetch-depth: 1 |
| 107 | + - name: Install Rust |
| 108 | + run: | |
| 109 | + curl -sSL https://sh.rustup.rs | sh -s -- -y --default-toolchain=beta --profile=minimal -c clippy |
| 110 | + echo "##[add-path]$HOME/.cargo/bin" |
| 111 | + export PATH="$PATH:$HOME/.cargo/bin" |
| 112 | + rustup update --no-self-update beta |
| 113 | + shell: bash |
| 114 | + - run: cargo clippy --all --all-targets -- -D clippy::nursery -Dwarnings |
0 commit comments