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

ci: split CI and PR workflows #55

Merged
merged 2 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
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
11 changes: 8 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
name: CD
on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [main] # semantic-release supports distribution channels via other branches
workflows:
- CI
types:
- completed
branches:
- main # semantic-release supports distribution channels via other branches

concurrency: cd # don't run multiple releases in parallel and mess up the versions

jobs:
build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: CI
on:
pull_request:
push:
branches: [main]
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -42,8 +42,3 @@ jobs:
uses: coverallsapp/github-action@v2.0.0
if: always()

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: always()
with:
fail_ci_if_error: true
42 changes: 42 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: PR
on:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
# setup
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Rust
uses: ./.github/actions/setup

- name: Install more cargo tools
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov,cargo-nextest

# test
- name: Run tests and generate coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info nextest --profile ci

- uses: mikepenz/action-junit-report@v3
if: always()
with:
check_name: test
report_paths: "**/junit.xml"

# lint
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features -- -D warnings
name: lint
if: always()

# coverage
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2.0.0
if: always()

1 change: 0 additions & 1 deletion codecov.yml

This file was deleted.