From 19005319c5cd90561a35656b7be1f33dc390fb4f Mon Sep 17 00:00:00 2001 From: Pavan Kumar Sunkara Date: Fri, 10 Apr 2020 12:31:46 +0200 Subject: [PATCH] Improvements to github actions --- .azure-pipelines.yml | 21 ++++--------- .github/workflows/benchmark.yml | 53 ++++++++++++++++----------------- .github/workflows/linux.yml | 30 +++++++++++++++++++ .travis.yml | 3 -- bors.toml | 2 ++ 5 files changed, 64 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/linux.yml diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index fac377ff09b..5393acbf115 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -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: @@ -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 @@ -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 diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index f35461b7b85..afeca4ff349 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -1,7 +1,5 @@ name: Benchmark on: - push: - branches: [master] pull_request: branches: [master] types: [opened, reopened, synchronize] @@ -9,38 +7,39 @@ 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 diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 00000000000..f6603911731 --- /dev/null +++ b/.github/workflows/linux.yml @@ -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 diff --git a/.travis.yml b/.travis.yml index 26048eb9e32..f646d8318f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/bors.toml b/bors.toml index aae74b98e80..6205d35e146 100644 --- a/bors.toml +++ b/bors.toml @@ -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