Skip to content

Commit

Permalink
Create new workflow for PRs
Browse files Browse the repository at this point in the history
CI workflow requires write permission and MSRV checks which isn't
something needed for PRs
  • Loading branch information
JamyGolden committed Jul 30, 2024
1 parent 43fa87f commit 89ce9ae
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: write

Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Pull Request
on:
pull_request:
branches: [main]

jobs:
setup-environment:
name: Set env vars
runs-on: ubuntu-latest
outputs:
cargo_cache_key: ${{ steps.cargo_cache_key.outputs.value }}
steps:
- uses: actions/checkout@v4
- name: Set cargo cache key
id: cargo_cache_key
run: |
CARGO_CACHE_KEY="${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}"
echo "value=$CARGO_CACHE_KEY" >> $GITHUB_OUTPUT
lint:
needs: setup-environment
uses: ./.github/workflows/lint.yml
with:
cache-key: ${{ needs.setup-environment.outputs.cargo_cache_key }}

test:
needs: setup-environment
uses: ./.github/workflows/test.yml
with:
cache-key: ${{ needs.setup-environment.outputs.cargo_cache_key }}

0 comments on commit 89ce9ae

Please sign in to comment.