Skip to content

Commit

Permalink
ci: split CI and PR workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianGoeb committed Oct 3, 2023
1 parent 5dc24be commit 5b7890d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 5 deletions.
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
4 changes: 2 additions & 2 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
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()

0 comments on commit 5b7890d

Please sign in to comment.