Skip to content
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

minor ci update around coverage/bench compare (we've seen issues in prs) #108

Merged
merged 1 commit into from
Jul 6, 2020
Merged
Changes from all commits
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
129 changes: 69 additions & 60 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ jobs:
if: failure() || cancelled()
with:
type: ${{ job.status }}
job_name: '*${{ github.workflow }}* Build @ audit'
job_name: "*${{ github.workflow }}* Build @ audit"
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}

# issue on critcmp: https://github.com/BurntSushi/critcmp/issues/5
bench-pr:
if: github.event_name == 'pull_request'
runs-on: ubuntu-18.04
Expand Down Expand Up @@ -67,6 +68,7 @@ jobs:
run: |
mkdir -p bench-runs
critcmp --export changes > bench-runs/changes.json
continue-on-error: true

- name: cache-cargo-build
uses: actions/cache@v1
Expand All @@ -87,16 +89,19 @@ jobs:
- name: export-bench-pr-master
working-directory: ./bench
run: critcmp --export master > bench-runs/master.json
continue-on-error: true

- name: compare-benches
working-directory: ./bench/bench-runs
run: critcmp master.json changes.json -t 5
continue-on-error: true

- name: upload-bench-exports
uses: actions/upload-artifact@v1
with:
name: criterion-cmp
path: ./bench/bench-runs
continue-on-error: true

- name: upload-bench-target
uses: actions/upload-artifact@v1
Expand All @@ -109,7 +114,7 @@ jobs:
if: failure() || cancelled()
with:
type: ${{ job.status }}
job_name: '*${{ github.workflow }}* @ bench-pr'
job_name: "*${{ github.workflow }}* @ bench-pr"
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -139,7 +144,7 @@ jobs:
if: failure() || cancelled()
with:
type: ${{ job.status }}
job_name: '*${{ github.workflow }}* @ bench'
job_name: "*${{ github.workflow }}* @ bench"
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -179,55 +184,55 @@ jobs:
if: failure() || cancelled()
with:
type: ${{ job.status }}
job_name: '*${{ github.workflow }}* @ check'
job_name: "*${{ github.workflow }}* @ check"
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}

coverage:
runs-on: ubuntu-18.04

container:
image: getcapsule/sandbox
options: --privileged

steps:
- name: install curl
run: apt-get update && apt-get install -y curl

- uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true

- name: install-tarpaulin
uses: actions-rs/cargo@v1
with:
command: install
args: --force cargo-tarpaulin

- name: run-tarpaulin
uses: actions-rs/cargo@v1
with:
command: tarpaulin
args: '-p capsule -l --count --exclude-files examples/* ffi/* macros/* --out Xml -Zpackage-features --features full'

- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./cobertura.xml

- name: slack-it
uses: homoluctus/[email protected]
if: failure() || cancelled()
with:
type: ${{ job.status }}
job_name: '*${{ github.workflow }}* @ coverage'
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}
# issue on tarpaulin: https://github.com/xd009642/tarpaulin/issues/461
# coverage:
# runs-on: ubuntu-18.04

# container:
# image: getcapsule/sandbox
# options: --privileged

# steps:
# - name: install curl
# run: apt-get update && apt-get install -y curl

# - uses: actions/checkout@v2

# - uses: actions-rs/toolchain@v1
# with:
# toolchain: nightly
# override: true

# - name: install-tarpaulin
# uses: actions-rs/cargo@v1
# with:
# command: install
# args: --force cargo-tarpaulin

# - name: run-tarpaulin
# uses: actions-rs/cargo@v1
# with:
# command: tarpaulin
# args: '-p capsule -l --count --exclude-files examples/* ffi/* macros/* --out Xml -Zpackage-features --features full'

# - uses: codecov/codecov-action@v1
# with:
# file: ./cobertura.xml

# - name: slack-it
# uses: homoluctus/[email protected]
# if: failure() || cancelled()
# with:
# type: ${{ job.status }}
# job_name: '*${{ github.workflow }}* @ coverage'
# url: ${{ secrets.SLACK_WEBHOOK }}
# commit: true
# token: ${{ secrets.GITHUB_TOKEN }}

format:
runs-on: ubuntu-18.04
Expand All @@ -250,7 +255,7 @@ jobs:
if: failure() || cancelled()
with:
type: ${{ job.status }}
job_name: '*${{ github.workflow }}* @ format'
job_name: "*${{ github.workflow }}* @ format"
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -273,7 +278,7 @@ jobs:
if: failure() || cancelled()
with:
type: ${{ job.status }}
job_name: '*${{ github.workflow }}* @ lint'
job_name: "*${{ github.workflow }}* @ lint"
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -307,7 +312,7 @@ jobs:
if: failure() || cancelled()
with:
type: ${{ job.status }}
job_name: '*${{ github.workflow }}* @ sanitize'
job_name: "*${{ github.workflow }}* @ sanitize"
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -330,61 +335,65 @@ jobs:
if: failure() || cancelled()
with:
type: ${{ job.status }}
job_name: '*${{ github.workflow }}* @ test'
job_name: "*${{ github.workflow }}* @ test"
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}

slack-pr:
if: github.event_name == 'pull_request'
needs: [audit, bench-pr, check, coverage, format, lint, sanitize, test]
# TODO: re-add coverage
needs: [audit, bench-pr, check, format, lint, sanitize, test]
runs-on: ubuntu-18.04
steps:
- name: slack-it
uses: homoluctus/[email protected]
if: always()
with:
type: ${{ job.status }}
job_name: '*${{ github.workflow }}*'
job_name: "*${{ github.workflow }}*"
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}

slack:
if: github.event_name == 'push'
needs: [audit, bench, check, coverage, format, lint, sanitize, test]
# TODO: re-add coverage
needs: [audit, bench, check, format, lint, sanitize, test]
runs-on: ubuntu-18.04
steps:
- name: slack-it
uses: homoluctus/[email protected]
if: always()
with:
type: ${{ job.status }}
job_name: '*${{ github.workflow }}*'
job_name: "*${{ github.workflow }}*"
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}

discord-pr:
if: github.event_name == 'pull_request'
needs: [audit, bench-pr, check, coverage, format, lint, sanitize, test]
# TODO: re-add coverage
needs: [audit, bench-pr, check, format, lint, sanitize, test]
runs-on: ubuntu-18.04
steps:
- name: discord-it
uses: rjstone/discord-webhook-notify@v1
with:
severity: info
description: '*${{ github.workflow }} PR Succeeded!* ~ ${{ github.HEAD_REF }} by ${{ github.ACTOR }} ~ https://github.com/capsule-rs/capsule/actions'
description: "*${{ github.workflow }} PR Succeeded!* ~ ${{ github.HEAD_REF }} by ${{ github.ACTOR }} ~ https://github.com/capsule-rs/capsule/actions"
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}

discord:
if: github.event_name == 'push'
needs: [audit, bench, check, coverage, format, lint, sanitize, test]
# TODO: re-add coverage
needs: [audit, bench, check, format, lint, sanitize, test]
runs-on: ubuntu-18.04
steps:
- name: discord-it
uses: rjstone/discord-webhook-notify@v1
with:
severity: info
description: '*${{ github.workflow }} Succeeded!* ~ ${{ github.HEAD_REF }} by ${{ github.ACTOR }} ~ https://github.com/capsule-rs/capsule/actions'
description: "*${{ github.workflow }} Succeeded!* ~ ${{ github.HEAD_REF }} by ${{ github.ACTOR }} ~ https://github.com/capsule-rs/capsule/actions"
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}