-
Notifications
You must be signed in to change notification settings - Fork 3
108 lines (103 loc) · 3.5 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Rust
on:
push:
branches:
- 'master'
- '!gh-pages'
pull_request:
jobs:
build:
runs-on: windows-latest
env:
# RUSTFLAGS: -Ctarget-feature=+crt-static
RUST_BACKTRACE: 1
MINGW_URL: https://ci-mirrors.rust-lang.org/rustc
strategy:
matrix:
target: [x86_64-pc-windows-msvc, i686-pc-windows-msvc, x86_64-pc-windows-gnu, i686-pc-windows-gnu]
include:
- target: x86_64-pc-windows-gnu
archive: x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z
mingw_dir: mingw64
- target: i686-pc-windows-gnu
archive: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z
mingw_dir: mingw32
steps:
- uses: actions/checkout@v2
- run: |
rustup toolchain install stable-${{ matrix.target }}
rustup default stable-${{ matrix.target }}
- name: Check out MinGW toolchain
run: |
set -x
curl -sSf -O "${MINGW_URL}/${{ matrix.archive }}"
7z x -y "${{ matrix.archive }}" -o/c/mingw
rm "${{ matrix.archive }}"
echo "##[add-path]C:\mingw\${{ matrix.mingw_dir }}\bin"
shell: bash
if: matrix.mingw_dir
- run: cargo build
- run: cargo build --all-targets
- run: cargo test
- if: failure()
run: |
Set-PSDebug -Trace 1
Get-ChildItem -Path target\debug\junction-test-*\ | Select-Object FullName, Target
Get-ChildItem -Path target\debug\junction-test-*\junction | Select-Object FullName, Target
shell: powershell
- if: failure()
run: |
dir /aL C:\
dir /aL C:\Users
shell: cmd
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: cargo fmt -- --check
rustdoc:
runs-on: windows-latest
if: github.event_name != 'pull_request' && github.event.ref == 'refs/heads/master'
needs: [build]
steps:
- uses: actions/checkout@v2
- run: |
rustup toolchain install nightly
rustup default nightly
- run: cargo doc --all --no-deps # --document-private-items
- run: echo '<meta http-equiv=refresh content=0;url=junction/index.html>' > target/doc/index.html
# - run: |
# Get-Service ssh-agent
# Get-Service ssh-agent | Select StartType
# Set-Service ssh-agent -StartupType Manual
# shell: powershell
- name: Commit docs to gh-pages branch
working-directory: target/doc
run: |
# Bypassing Jekyll on GitHub Pages
touch .nojekyll
REV=$(git rev-parse --short HEAD)
git init
git config user.name "Actions"
git config user.email "Actions@example.com"
git config --global core.autocrlf false
git add -A .
git commit -qm "Documentation for ${{github.repository}}@${REV}"
shell: bash
- name: Push gh-pages to GitHub
working-directory: target/doc
run: |
git remote add upstream https://x-access-token:${{secrets.GITHUB_TOKEN}}@github.com/lzutao/junction
git push -q upstream HEAD:gh-pages --force
clippy:
runs-on: windows-latest
needs: [build]
steps:
- uses: actions/checkout@v2
- run: |
rustup toolchain install nightly -c clippy
rustup default nightly
- run: |
cargo check --all-targets --all-features
git ls-files '*.rs' | xargs touch
- run: cargo clippy --all-targets --all-features -- -Dwarnings