Skip to content

Commit

Permalink
Improvements to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
pksunkara committed Apr 10, 2020
1 parent 2385ff8 commit 1900531
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 45 deletions.
21 changes: 6 additions & 15 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ stages:
rust: 1.40.0
strategy:
matrix:
Windows 32-bit (MSVC):
MSVC 32-bit:
image: vs2017-win2016
target: i686-pc-windows-msvc
Windows 64-bit (MSVC):
MSVC 64-bit:
image: vs2017-win2016
target: x86_64-pc-windows-msvc
Windows 32-bit (MinGW):
MinGW 32-bit:
image: vs2017-win2016
target: i686-pc-windows-gnu
Windows 64-bit (MinGW):
MinGW 64-bit:
image: vs2017-win2016
target: x86_64-pc-windows-gnu
pool:
Expand All @@ -40,12 +40,7 @@ stages:
inputs:
key: cargo | "$(rust)" | $(target) | Cargo.toml
path: C:\Rust\.cargo
displayName: Caching cargo
- task: Cache@2
inputs:
key: compiled | "$(rust)" | $(target) | Cargo.toml
path: target
displayName: Caching compiled
displayName: Cache cargo
- script: rustup default $(rust)-$(target)
displayName: Install rust
- script: cargo test --no-default-features
Expand All @@ -58,9 +53,5 @@ stages:
RUST_BACKTRACE: full
- script: |
rmdir /Q /S C:\Rust\.cargo\registry\src
rmdir /Q /S target\.rustc_info.json
rmdir /Q /S target\debug\examples
rmdir /Q /S target\debug\incremental
rmdir /Q /S target\tests\target\debug\incremental
displayName: Cleaning for cache
displayName: Cleanup cache
continueOnError: true
53 changes: 26 additions & 27 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,45 @@
name: Benchmark
on:
push:
branches: [master]
pull_request:
branches: [master]
types: [opened, reopened, synchronize]
jobs:
Benchmark:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Checkout base
uses: actions/checkout@v2
- name: Update rust
run: rustup toolchain update stable
- name: Run benchmarks
run: cargo bench -- -R bencher | tee output.txt
- name: Download base benchmark
with:
ref: master
- name: Cache cargo
uses: actions/cache@v1
with:
path: ./cache
key: ${{ runner.os }}-benchmark-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-benchmark-${{ github.ref }}-${{ github.sha }}
${{ runner.os }}-benchmark-${{ github.ref }}
${{ runner.os }}-benchmark
- name: Compare benchmarks for Pull Requests
uses: rhysd/github-action-benchmark@v1
if: github.event_name == 'pull_request'
path: ~/.cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Bench base
run: cargo bench -- -R bencher | tee output.txt
- name: Save base benchmark
uses: pksunkara/github-action-benchmark@v1
with:
tool: cargo
output-file-path: output.txt
external-data-json-path: ./cache/benchmark-data.json
github-token: ${{ github.token }}
comment-always: true
save-data-file: false
- name: Compare benchmarks for master branch
uses: rhysd/github-action-benchmark@v1
if: github.event_name == 'push'
external-data-json-path: ./benchmark-data.json
read-commit-id: true
- name: Checkout pull request
uses: actions/checkout@v2
with:
clean: false
- name: Bench pull request
run: cargo bench -- -R bencher | tee output.txt
- name: Compare benchmarks
uses: pksunkara/github-action-benchmark@v1
with:
tool: cargo
output-file-path: output.txt
external-data-json-path: ./cache/benchmark-data.json
external-data-json-path: ./benchmark-data.json
github-token: ${{ github.token }}
alert-threshold: 125%
comment-on-alert: true
comment-always: true
30 changes: 30 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Linux
on:
push:
branches: [master, staging, trying]
pull_request:
branches: [master, staging, trying]
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: Cache cargo
uses: actions/cache@v1
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: Cleanup cache
run: rm -rf ~/.cargo/registry/src
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
- rust: beta
- rust: nightly
cache: false
- name: Release profile tests
script:
- cargo test -v --release --features yaml unstable
- name: Linting (fmt + clippy)
before_script:
- rustup component add clippy
Expand Down
2 changes: 2 additions & 0 deletions bors.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
status = [
"continuous-integration/travis-ci/push",
"clap-rs.clap",
"Release Profile Tests",
]
pr_status = [
"continuous-integration/travis-ci/pr",
"clap-rs.clap",
"Release Profile Tests",
]
timeout_sec = 7200
prerun_timeout_sec = 7200
Expand Down

0 comments on commit 1900531

Please sign in to comment.