1- name : Test libloading
1+ concurrency :
2+ group : ${{ github.workflow }}-${{ github.ref }}
3+ cancel-in-progress : true
24
35on :
46 push :
5- paths-ignore :
6- - ' *.mkd'
7- - ' LICENSE'
7+ branches : [master]
8+ paths-ignore : ['*.mkd', 'LICENSE']
89 pull_request :
910 types : [opened, reopened, synchronize]
1011
@@ -19,38 +20,18 @@ jobs:
1920 timeout-minutes : 20
2021 steps :
2122 - uses : actions/checkout@v2
22- - name : Install Rust ${{ matrix.rust_toolchain }}
23- uses : actions-rs/toolchain@v1
24- with :
25- toolchain : ${{ matrix.rust_toolchain }}
26- profile : minimal
27- components : clippy
28- default : true
29- - name : Clippy
30- uses : actions-rs/cargo@v1
31- with :
32- command : clippy
33- - name : Test
34- uses : actions-rs/cargo@v1
35- with :
36- command : test
37- args : -- --nocapture
38- - name : Test Release
39- uses : actions-rs/cargo@v1
40- with :
41- command : test
42- args : --release -- --nocapture
43- - name : Documentation
44- uses : actions-rs/cargo@v1
45- with :
46- command : rustdoc
47- args : |
48- -Zunstable-options
49- --config
50- 'build.rustdocflags=["--cfg", "libloading_docs", "-D", "rustdoc::broken_intra_doc_links"]'
23+ - run : rustup install ${{ matrix.rust_toolchain }} --profile=minimal
24+ - run : rustup default ${{ matrix.rust_toolchain }}
25+ - run : rustup component add clippy
26+ - run : cargo clippy
27+ - run : cargo test -- --nocapture
28+ - run : cargo test --release -- --nocapture
29+ - run : cargo rustdoc -Zunstable-options --config 'build.rustdocflags=["--cfg", "libloading_docs", "-D", "rustdoc::broken_intra_doc_links"]'
5130 if : ${{ matrix.rust_toolchain == 'nightly' }}
31+ # pwsh.exe drops quotes kekw. https://stackoverflow.com/a/59036879
32+ shell : bash
5233
53- windows-gnu- test :
34+ windows-test :
5435 runs-on : windows-latest
5536 strategy :
5637 fail-fast : false
@@ -59,39 +40,35 @@ jobs:
5940 rust_target :
6041 - x86_64-pc-windows-gnu
6142 - i686-pc-windows-gnu
43+ include :
44+ - rust_target : x86_64-pc-windows-gnu
45+ mingw_path : C:/msys64/mingw64/bin
46+ package : mingw-w64-x86_64-gcc
47+ - rust_target : i686-pc-windows-gnu
48+ mingw_path : C:/msys64/mingw32/bin
49+ package : mingw-w64-i686-gcc
6250 steps :
6351 - uses : actions/checkout@v2
64- - name : Add MSYS2 to the PATH
65- run : echo "c:/msys64/bin" | Out-File -FilePath $env:GITHUB_PATH -Append
66- - name : Add 32-bit mingw-w64 to the PATH
67- run : echo "c:/msys64/mingw32/bin" | Out-File -FilePath $env:GITHUB_PATH -Append
68- if : startsWith(matrix.rust_target, 'i686')
69- - name : Add 64-bit mingw-w64 to the PATH
70- run : echo "c:/msys64/mingw64/bin" | Out-File -FilePath $env:GITHUB_PATH -Append
71- if : startsWith(matrix.rust_target, 'x86_64')
72- - name : Set TARGET variable
73- run : echo "TARGET=${{ matrix.rust_target}}" | Out-File -FilePath $env:GITHUB_ENV -Append
74- - name : Install Rust nightly
75- uses : actions-rs/toolchain@v1
76- with :
77- toolchain : ${{ matrix.rust_toolchain }}
78- target : ${{ matrix.rust_target }}
79- profile : minimal
80- default : true
81- - uses : actions-rs/cargo@v1
82- with :
83- command : build
84- args : --target ${{ matrix.rust_target }} --manifest-path=Cargo.toml
85- - uses : actions-rs/cargo@v1
52+ - run : rustup install ${{ matrix.rust_toolchain }} --profile=minimal
53+ - run : rustup default ${{ matrix.rust_toolchain }}
54+ - run : rustup target add ${{ matrix.rust_target }}
55+ - uses : msys2/setup-msys2@v2
8656 with :
87- command : test
88- args : --target ${{ matrix.rust_target }} --manifest-path=Cargo.toml
57+ release : false
58+ install : ${{ matrix.package }}
59+ - run : echo "c:/msys64/bin" | Out-File -FilePath $env:GITHUB_PATH -Append
60+ - run : echo "${{ matrix.mingw_path }}" | Out-File -FilePath $env:GITHUB_PATH -Append
61+ if : ${{ matrix.mingw_path }}"
62+ - run : cargo test --target ${{ matrix.rust_target }}
63+ env :
64+ TARGET : ${{ matrix.rust_target}}
8965
9066 bare-cross-build :
9167 runs-on : ubuntu-latest
9268 strategy :
9369 fail-fast : false
9470 matrix :
71+ rust_toolchain : [nightly]
9572 rust_target :
9673 # BSDs: could be tested with full system emulation
9774 # - x86_64-unknown-dragonfly
@@ -105,25 +82,10 @@ jobs:
10582 timeout-minutes : 20
10683 steps :
10784 - uses : actions/checkout@v2
108- - name : Install Rust nightly
109- uses : actions-rs/toolchain@v1
110- with :
111- toolchain : nightly
112- profile : minimal
113- default : true
114- - name : Fix-up toolchain
115- run : |
116- rustup component add rust-src --toolchain nightly --target ${{ matrix.rust_target }}
117- - name : Update
118- uses : actions-rs/cargo@v1
119- with :
120- command : update
121- args : --manifest-path=Cargo.toml
122- - name : Build ${{ matrix.rust_target }}
123- uses : actions-rs/cargo@v1
124- with :
125- command : build
126- args : --target ${{ matrix.rust_target }} --manifest-path=Cargo.toml -Zbuild-std
85+ - run : rustup install ${{ matrix.rust_toolchain }} --profile=minimal
86+ - run : rustup default ${{ matrix.rust_toolchain }}
87+ - run : rustup component add rust-src --toolchain nightly --target ${{ matrix.rust_target }}
88+ - run : cargo build --target ${{ matrix.rust_target }} -Zbuild-std
12789
12890 cross-ios-build :
12991 runs-on : macos-latest
@@ -137,20 +99,7 @@ jobs:
13799 timeout-minutes : 20
138100 steps :
139101 - uses : actions/checkout@v2
140- - name : Install Rust ${{ matrix.rust_toolchain }}
141- uses : actions-rs/toolchain@v1
142- with :
143- toolchain : ${{ matrix.rust_toolchain }}
144- target : ${{ matrix.rust_target }}
145- profile : minimal
146- default : true
147- - name : Update
148- uses : actions-rs/cargo@v1
149- with :
150- command : update
151- args : --manifest-path=Cargo.toml
152- - name : Build ${{ matrix.rust_target }}
153- uses : actions-rs/cargo@v1
154- with :
155- command : build
156- args : --target=${{ matrix.rust_target }} --manifest-path=Cargo.toml
102+ - run : rustup install ${{ matrix.rust_toolchain }} --profile=minimal
103+ - run : rustup default ${{ matrix.rust_toolchain }}
104+ - run : rustup target add ${{ matrix.rust_target }}
105+ - run : cargo build --target=${{ matrix.rust_target }}
0 commit comments