Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Update GitHub PR workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
imyourmanzi committed Apr 30, 2023
1 parent de2b91b commit d30cba1
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/pull-request-affected-projects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: 'Affected Projects'

on:
pull_request:
branches:
- main

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: 'Checkout branch'
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Use Node 18'
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: 'Set up Nx'
uses: nrwl/nx-set-shas@v3
- name: 'Install dependencies'
run: 'npm ci'
- name: 'Build projects'
run: 'npx nx affected --target=build'
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: 'Checkout branch'
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Use Node 18'
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: 'Set up Nx'
uses: nrwl/nx-set-shas@v3
- name: 'Install dependencies'
run: 'npm ci'
- name: 'Lint projects'
run: 'npx nx affected --target=lint'
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: 'Checkout branch'
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Use Node 18'
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: 'Set up Nx'
uses: nrwl/nx-set-shas@v3
- name: 'Install dependencies'
run: 'npm ci'
- name: 'Test projects'
run: 'npx nx affected --target=test --ci --code-coverage'
24 changes: 24 additions & 0 deletions .github/workflows/pull-request-firebase-hosting-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR

on: pull_request

jobs:
build_and_preview:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci
- run: npx nx build ui
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_IMYOURMANZI_SPOTIFYPLAYLISTMGR }}
projectId: imyourmanzi-spotifyplaylistmgr
27 changes: 27 additions & 0 deletions .github/workflows/pull-request-terraform-plan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Terraform PR

on:
pull_request:
branches:
- main
paths:
- 'infrastructure/'

jobs:
infrastructure:
name: Plan Infrastructure
runs-on: ubuntu-latest
defaults:
run:
working-directory: infrastructure
steps:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
with:
cli_config_credentials_hostname: 'app.terraform.io'
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
terraform_version: 1.4
terraform_wrapper: false
- run: terraform init
- run: terraform validate
- run: terraform plan -no-color
19 changes: 19 additions & 0 deletions .github/workflows/pull-request-version.skip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Check Version'

on:
pull_request:
branches:
- main
paths-ignore:
- 'packages/**'
- 'package*.json'
- 'tsconfig.base.json'
- 'babel.config.json'
- 'nx.json'
- 'workspace.json'

jobs:
check:
name: Check
steps:
- run: 'echo "No version bump required"'
18 changes: 18 additions & 0 deletions .github/workflows/pull-request-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Check Version'

on:
pull_request:
branches:
- main
paths:
- 'packages/**'
- 'package*.json'
- 'tsconfig.base.json'
- 'babel.config.json'
- 'nx.json'
- 'workspace.json'

jobs:
check:
name: Check
uses: imyourmanzi/GitHubWorkflows/.github/workflows/package-json-version-check.yml@main

0 comments on commit d30cba1

Please sign in to comment.