Skip to content

Commit abc2ada

Browse files
committed
Use github actions for windows
1 parent 0a3921f commit abc2ada

File tree

7 files changed

+134
-63
lines changed

7 files changed

+134
-63
lines changed

.azure-pipelines.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ stages:
1717
rust: 1.40.0
1818
strategy:
1919
matrix:
20-
MSVC 32-bit:
21-
image: vs2017-win2016
22-
target: i686-pc-windows-msvc
23-
MSVC 64-bit:
24-
image: vs2017-win2016
25-
target: x86_64-pc-windows-msvc
2620
MinGW 32-bit:
2721
image: vs2017-win2016
2822
target: i686-pc-windows-gnu
@@ -36,18 +30,9 @@ stages:
3630
fetchDepth: 1
3731
path: clap
3832
displayName: Checkout repository
39-
- task: Cache@2
40-
inputs:
41-
key: cargo | "$(rust)" | $(target) | Cargo.toml
42-
path: C:\Rust\.cargo
43-
displayName: Cache cargo
4433
- script: rustup default $(rust)-$(target)
4534
displayName: Install rust
4635
- script: cargo test --no-default-features --features "std cargo" -p clap:3.0.0-beta.1
4736
displayName: Test with almost no features
4837
- script: cargo test --features "yaml unstable"
4938
displayName: Test with most features
50-
- script: |
51-
rmdir /Q /S C:\Rust\.cargo\registry\src
52-
displayName: Cleanup cache
53-
continueOnError: true

.github/workflows/benchmark.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ jobs:
4646
external-data-json-path: ./benchmark-data.json
4747
github-token: ${{ github.token }}
4848
annotate-always: true
49-
- name: temporary
50-
run: rm ~/.cargo/bin/cargo-cache
5149
- name: Install cargo-cache
5250
uses: actions-rs/[email protected]
5351
if: steps.cache.outputs.cache-hit != 'true'

.github/workflows/ci.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [staging, trying]
5+
pull_request:
6+
branches: [master]
7+
types: [opened, reopened, synchronize]
8+
jobs:
9+
test:
10+
name: Tests
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [windows-latest, macos-latest, ubuntu-latest]
15+
rust: [1.40.0]
16+
target:
17+
- i686-pc-windows-msvc
18+
- x86_64-pc-windows-msvc
19+
# - i686-pc-windows-gnu
20+
# - x86_64-pc-windows-gnu
21+
# - i686-unknown-linux-gnu
22+
- x86_64-unknown-linux-gnu
23+
- x86_64-apple-darwin
24+
features: [all, none]
25+
exclude:
26+
- os: windows-latest
27+
target: x86_64-apple-darwin
28+
# - os: windows-latest
29+
# target: i686-unknown-linux-gnu
30+
- os: windows-latest
31+
target: x86_64-unknown-linux-gnu
32+
- os: macos-latest
33+
target: i686-pc-windows-msvc
34+
- os: macos-latest
35+
target: x86_64-pc-windows-msvc
36+
# - os: macos-latest
37+
# target: i686-pc-windows-gnu
38+
# - os: macos-latest
39+
# target: x86_64-pc-windows-gnu
40+
# - os: macos-latest
41+
# target: i686-unknown-linux-gnu
42+
- os: macos-latest
43+
target: x86_64-unknown-linux-gnu
44+
- os: ubuntu-latest
45+
target: i686-pc-windows-msvc
46+
- os: ubuntu-latest
47+
target: x86_64-pc-windows-msvc
48+
# - os: ubuntu-latest
49+
# target: i686-pc-windows-gnu
50+
# - os: ubuntu-latest
51+
# target: x86_64-pc-windows-gnu
52+
- os: ubuntu-latest
53+
target: x86_64-apple-darwin
54+
runs-on: ${{ matrix.os }}
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v2
58+
- name: Install rust
59+
uses: actions-rs/toolchain@v1
60+
with:
61+
toolchain: ${{ matrix.rust }}
62+
target: ${{ matrix.target }}
63+
override: true
64+
- name: Ready cache
65+
if: matrix.os == 'ubuntu-latest'
66+
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
67+
- name: Cache cargo
68+
uses: actions/cache@v1
69+
id: cache
70+
with:
71+
path: ~/.cargo
72+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
73+
- name: Test almost no features
74+
uses: actions-rs/cargo@v1
75+
if: matrix.features == 'none'
76+
with:
77+
command: test
78+
args: --target ${{ matrix.target }} --no-default-features --features "std cargo" -p clap:3.0.0-beta.1
79+
- name: Test all features
80+
uses: actions-rs/cargo@v1
81+
if: matrix.features == 'all'
82+
with:
83+
command: test
84+
args: --target ${{ matrix.target }} --features "yaml unstable"
85+
- name: Install cargo-cache
86+
uses: actions-rs/[email protected]
87+
if: steps.cache.outputs.cache-hit != 'true'
88+
with:
89+
crate: cargo-cache
90+
use-tool-cache: true
91+
- name: Cleanup cache
92+
if: steps.cache.outputs.cache-hit != 'true'
93+
run: cargo cache -a
94+
# https://github.com/rust-lang/rust/issues/29497
95+
- name: Cleanup windows cache
96+
if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'windows-latest'
97+
shell: bash
98+
run: |
99+
rm -rf ~/.cargo/git/checkouts
100+
rm -rf ~/.cargo/registry/index
101+
test-release:
102+
name: Release Profile Tests
103+
runs-on: ubuntu-latest
104+
steps:
105+
- name: Install rust
106+
uses: actions-rs/toolchain@v1
107+
with:
108+
toolchain: stable
109+
- name: Checkout
110+
uses: actions/checkout@v2
111+
- name: Ready cache
112+
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
113+
- name: Cache cargo
114+
uses: actions/cache@v1
115+
id: cache
116+
with:
117+
path: ~/.cargo
118+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
119+
- name: Test
120+
uses: actions-rs/cargo@v1
121+
with:
122+
command: test
123+
args: --release --features "yaml unstable"
124+
- name: Install cargo-cache
125+
uses: actions-rs/[email protected]
126+
if: steps.cache.outputs.cache-hit != 'true'
127+
with:
128+
crate: cargo-cache
129+
use-tool-cache: true
130+
- name: Cleanup cache
131+
if: steps.cache.outputs.cache-hit != 'true'
132+
run: cargo cache -a

.github/workflows/linux.yml

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

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ jobs:
2828
- rust: nightly
2929
fast_finish: true
3030
include:
31-
- os: osx
32-
rust: 1.40.0
33-
- rust: 1.40.0
3431
- {}
3532
- rust: beta
3633
- rust: nightly

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ harness = false
5454
name = "06_rustup"
5555

5656
[badges]
57-
travis-ci = { repository = "clap-rs/clap", branch = "master" }
58-
azure-devops = { project = "clap-rs/clap", pipeline = "clap-rs.clap" }
59-
coveralls = { repository = "clap-rs/clap", branch = "master" }
6057
is-it-maintained-issue-resolution = { repository = "clap-rs/clap" }
6158
is-it-maintained-open-issues = { repository = "clap-rs/clap" }
6259
maintenance = {status = "actively-developed"}

bors.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
status = [
22
"continuous-integration/travis-ci/push",
33
"clap-rs.clap",
4+
"Tests",
45
"Release Profile Tests",
56
]
67
pr_status = [
78
"continuous-integration/travis-ci/pr",
89
"clap-rs.clap",
10+
"Tests",
911
"Release Profile Tests",
1012
]
1113
timeout_sec = 7200

0 commit comments

Comments
 (0)