Run CI on Windows

This commit is contained in:
Ajeet D'Souza 2020-10-27 01:25:02 +05:30
parent 5c3af59ba6
commit 9dd1679e5a
7 changed files with 38 additions and 7 deletions

View File

@ -11,7 +11,10 @@ on:
jobs:
audit:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/audit-check@v1

View File

@ -6,7 +6,10 @@ on:
jobs:
clippy:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1

View File

@ -5,7 +5,7 @@ on:
pull_request:
jobs:
test:
test-linux:
runs-on: ubuntu-18.04
steps:
- run: sudo apt update
@ -26,3 +26,16 @@ jobs:
with:
command: test
args: --all-features --no-fail-fast
test-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --no-fail-fast

View File

@ -6,7 +6,10 @@ on:
jobs:
udeps:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1

View File

@ -25,7 +25,7 @@ tempfile = "3.1.0"
[target.'cfg(windows)'.dependencies]
rand = "0.7.3"
[dev-dependencies]
[target.'cfg(unix)'.dev-dependencies]
assert_cmd = "1.0.1"
[profile.release]

View File

@ -41,6 +41,7 @@ pub enum Hook {
Pwd,
}
#[cfg(unix)]
#[cfg(test)]
mod tests {
use super::*;

View File

@ -246,7 +246,11 @@ mod tests {
#[test]
fn test_add() {
let path = "/foo/bar";
let path = if cfg!(windows) {
r"C:\foo\bar"
} else {
"/foo/bar"
};
let now = 946684800;
let data_dir = tempfile::tempdir().unwrap();
@ -267,7 +271,11 @@ mod tests {
#[test]
fn test_remove() {
let path = "/foo/bar";
let path = if cfg!(windows) {
r"C:\foo\bar"
} else {
"/foo/bar"
};
let now = 946684800;
let data_dir = tempfile::tempdir().unwrap();