Use github actions for windows

This commit is contained in:
Pavan Kumar Sunkara 2020-04-20 23:16:33 +02:00
parent 0a3921f554
commit abc2ada63f
7 changed files with 134 additions and 63 deletions

View file

@ -17,12 +17,6 @@ stages:
rust: 1.40.0
strategy:
matrix:
MSVC 32-bit:
image: vs2017-win2016
target: i686-pc-windows-msvc
MSVC 64-bit:
image: vs2017-win2016
target: x86_64-pc-windows-msvc
MinGW 32-bit:
image: vs2017-win2016
target: i686-pc-windows-gnu
@ -36,18 +30,9 @@ stages:
fetchDepth: 1
path: clap
displayName: Checkout repository
- task: Cache@2
inputs:
key: cargo | "$(rust)" | $(target) | Cargo.toml
path: C:\Rust\.cargo
displayName: Cache cargo
- script: rustup default $(rust)-$(target)
displayName: Install rust
- script: cargo test --no-default-features --features "std cargo" -p clap:3.0.0-beta.1
displayName: Test with almost no features
- script: cargo test --features "yaml unstable"
displayName: Test with most features
- script: |
rmdir /Q /S C:\Rust\.cargo\registry\src
displayName: Cleanup cache
continueOnError: true

View file

@ -46,8 +46,6 @@ jobs:
external-data-json-path: ./benchmark-data.json
github-token: ${{ github.token }}
annotate-always: true
- name: temporary
run: rm ~/.cargo/bin/cargo-cache
- name: Install cargo-cache
uses: actions-rs/install@v0.1
if: steps.cache.outputs.cache-hit != 'true'

132
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,132 @@
name: CI
on:
push:
branches: [staging, trying]
pull_request:
branches: [master]
types: [opened, reopened, synchronize]
jobs:
test:
name: Tests
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
rust: [1.40.0]
target:
- i686-pc-windows-msvc
- x86_64-pc-windows-msvc
# - i686-pc-windows-gnu
# - x86_64-pc-windows-gnu
# - i686-unknown-linux-gnu
- x86_64-unknown-linux-gnu
- x86_64-apple-darwin
features: [all, none]
exclude:
- os: windows-latest
target: x86_64-apple-darwin
# - os: windows-latest
# target: i686-unknown-linux-gnu
- os: windows-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: i686-pc-windows-msvc
- os: macos-latest
target: x86_64-pc-windows-msvc
# - os: macos-latest
# target: i686-pc-windows-gnu
# - os: macos-latest
# target: x86_64-pc-windows-gnu
# - os: macos-latest
# target: i686-unknown-linux-gnu
- os: macos-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: i686-pc-windows-msvc
- os: ubuntu-latest
target: x86_64-pc-windows-msvc
# - os: ubuntu-latest
# target: i686-pc-windows-gnu
# - os: ubuntu-latest
# target: x86_64-pc-windows-gnu
- os: ubuntu-latest
target: x86_64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- name: Ready cache
if: matrix.os == 'ubuntu-latest'
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
- name: Cache cargo
uses: actions/cache@v1
id: cache
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Test almost no features
uses: actions-rs/cargo@v1
if: matrix.features == 'none'
with:
command: test
args: --target ${{ matrix.target }} --no-default-features --features "std cargo" -p clap:3.0.0-beta.1
- name: Test all features
uses: actions-rs/cargo@v1
if: matrix.features == 'all'
with:
command: test
args: --target ${{ matrix.target }} --features "yaml unstable"
- name: Install cargo-cache
uses: actions-rs/install@v0.1
if: steps.cache.outputs.cache-hit != 'true'
with:
crate: cargo-cache
use-tool-cache: true
- name: Cleanup cache
if: steps.cache.outputs.cache-hit != 'true'
run: cargo cache -a
# https://github.com/rust-lang/rust/issues/29497
- name: Cleanup windows cache
if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'windows-latest'
shell: bash
run: |
rm -rf ~/.cargo/git/checkouts
rm -rf ~/.cargo/registry/index
test-release:
name: Release Profile Tests
runs-on: ubuntu-latest
steps:
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Checkout
uses: actions/checkout@v2
- name: Ready cache
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
- name: Cache cargo
uses: actions/cache@v1
id: cache
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --release --features "yaml unstable"
- name: Install cargo-cache
uses: actions-rs/install@v0.1
if: steps.cache.outputs.cache-hit != 'true'
with:
crate: cargo-cache
use-tool-cache: true
- name: Cleanup cache
if: steps.cache.outputs.cache-hit != 'true'
run: cargo cache -a

View file

@ -1,40 +0,0 @@
name: Linux
on:
push:
branches: [staging, trying]
pull_request:
branches: [master]
types: [opened, reopened, synchronize]
jobs:
test-release:
name: Release Profile Tests
runs-on: ubuntu-latest
steps:
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Checkout
uses: actions/checkout@v2
- name: Ready cache
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
- name: Cache cargo
uses: actions/cache@v1
id: cache
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --release --features "yaml unstable"
- name: Install cargo-cache
uses: actions-rs/install@v0.1
if: steps.cache.outputs.cache-hit != 'true'
with:
crate: cargo-cache
use-tool-cache: true
- name: Cleanup cache
if: steps.cache.outputs.cache-hit != 'true'
run: cargo cache -a

View file

@ -28,9 +28,6 @@ jobs:
- rust: nightly
fast_finish: true
include:
- os: osx
rust: 1.40.0
- rust: 1.40.0
- {}
- rust: beta
- rust: nightly

View file

@ -54,9 +54,6 @@ harness = false
name = "06_rustup"
[badges]
travis-ci = { repository = "clap-rs/clap", branch = "master" }
azure-devops = { project = "clap-rs/clap", pipeline = "clap-rs.clap" }
coveralls = { repository = "clap-rs/clap", branch = "master" }
is-it-maintained-issue-resolution = { repository = "clap-rs/clap" }
is-it-maintained-open-issues = { repository = "clap-rs/clap" }
maintenance = {status = "actively-developed"}

View file

@ -1,11 +1,13 @@
status = [
"continuous-integration/travis-ci/push",
"clap-rs.clap",
"Tests",
"Release Profile Tests",
]
pr_status = [
"continuous-integration/travis-ci/pr",
"clap-rs.clap",
"Tests",
"Release Profile Tests",
]
timeout_sec = 7200