Skip to content

Use github actions for windows #1845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 0 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
if: steps.cache.outputs.cache-hit != 'true'
Expand Down
132 changes: 132 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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/[email protected]
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
40 changes: 0 additions & 40 deletions .github/workflows/linux.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
2 changes: 2 additions & 0 deletions bors.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down