Skip to content

Commit 02570dd

Browse files
authored
Merge pull request #2 from lzutao/ghactions
Migrate to GitHub actions
2 parents c8165b4 + b9e0f1d commit 02570dd

File tree

12 files changed

+321
-282
lines changed

12 files changed

+321
-282
lines changed

.github/workflows/ci.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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

.rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
max_width = 120

Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ description = "library for working with NTFS junctions"
1919
[package.metadata.docs.rs]
2020
default-target = "x86_64-pc-windows-msvc"
2121

22-
[dependencies]
23-
scopeguard = "1"
22+
[target.'cfg(windows)'.dependencies.scopeguard]
23+
version = "1"
24+
default-features = false
2425

2526
[target.'cfg(windows)'.dependencies.winapi]
2627
version = "0.3"
@@ -30,6 +31,8 @@ features = [
3031
"guiddef",
3132
"handleapi",
3233
"ioapiset",
34+
"processthreadsapi",
35+
"securitybaseapi",
3336
"winbase",
3437
"winioctl",
3538
"winnt",

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Library for working with NTFS junctions.
44

5-
[![Build Status][azure-badge]][azure-url]
5+
[![Build Status][actions-badge]][actions-url]
66
[![Documentation](https://docs.rs/junction/badge.svg)](https://docs.rs/junction)
77
[![Crates.io](https://img.shields.io/crates/v/junction.svg)](https://crates.io/crates/junction)
88

@@ -17,10 +17,10 @@ Add this to your `Cargo.toml`:
1717
junction = "0.1"
1818
```
1919

20-
[azure-badge]: https://dev.azure.com/taolzu/junction/_apis/build/status/lzutao.junction?branchName=master
21-
[azure-url]: https://dev.azure.com/taolzu/junction/_build/latest?definitionId=3&branchName=master
20+
[actions-badge]: https://github.com/lzutao/junction/workflows/Rust/badge.svg?branchName=master
21+
[actions-url]: https://github.com/lzutao/junction/actions
2222

23-
## Documentations when developing this crate
23+
## All relevant references
2424

2525
* https://www.codeproject.com/Articles/194/Windows-2000-Junction-Points#The_Solution
2626
* https://www.codeproject.com/Articles/15633/Manipulating-NTFS-Junction-Points-in-NET
@@ -33,4 +33,4 @@ junction = "0.1"
3333
## License
3434

3535
All the code in this repository is released under the MIT License,
36-
for more information take a look at the COPYRIGHT file.
36+
for more information read COPYRIGHT file.

azure-pipelines.yml

Lines changed: 0 additions & 102 deletions
This file was deleted.

ci/id_ed25519.enc

-16 Bytes
Binary file not shown.

ci/install-rust.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

ci/install_mingw.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)