Skip to content

Commit

Permalink
GitHub workflow attempt #1
Browse files Browse the repository at this point in the history
  • Loading branch information
dannymcgee committed May 10, 2024
1 parent 41b3bea commit 4d0c4d2
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: PR Validation
on:
pull_request:
branches:
- main

jobs:
checkout-repo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Ensure unambiguous `main`
if: github.ref != 'refs/heads/main'
run: |
git remote set-branches origin main
git fetch --depth 1 origin main
git branch main origin/main
setup-rust:
runs-on: ubuntu-latest
needs: checkout-repo
steps:
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-setup-rust-${{ hashFiles('**/Cargo.toml') }}
- name: Set default Rust toolchain
run: rustup default stable
- name: Verify Rust setup
run: rustup show

setup-node:
runs-on: ubuntu-latest
needs: checkout-repo
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- uses: actions/cache@v4
with:
path: node_modules/
key: ${{ runner.os }}-setup-node-${{ hashFiles('**/package.json', '**/package-lock.json') }}
- name: Install node dependencies
run: npm ci

validate-affected:
runs-on: ubuntu-latest
needs:
- setup-rust
- setup-node
steps:
- name: nx affected
run: npx nx affected -t format lint test --configuration ci

0 comments on commit 4d0c4d2

Please sign in to comment.