Skip to content

Commit

Permalink
ci(github): add workflow to build and test application on each push
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonGolms committed Nov 15, 2022
1 parent 412eb3d commit 13e8b74
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Test
on: [push]

jobs:
build_and_test:
name: 'Build and Test'
runs-on: ubuntu-20.04
container:
# Using the playwright container (https://mcr.microsoft.com/product/playwright/about)
# for performance reasons to avoid having to download and install all dependencies again.
image: mcr.microsoft.com/playwright:v1.27.1-focal
# Container should run with the same user of the host VM, otherwise it leads to permission issues
# see: https://github.com/actions/runner/issues/691 & https://github.com/actions/checkout/issues/211#issuecomment-680107607
options: --user 1001
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
# Ignore README.md from find results to avoid unintentionally changes on the release step
- name: Setup Quickstarter (Project ID)
run: find . -type f \( ! -name "README.md" \) -exec sed -i 's/PROJECTID/foo/g' {} +
# Ignore README.md from find results to avoid unintentionally changes on the release step
- name: Setup Quickstarter (Component ID)
run: find . -type f \( ! -name "README.md" \) -exec sed -i 's/COMPONENTID/app/g' {} +
- name: Install Dependencies
run: npm ci
- name: Analyze Code - Check ESLint Rules
run: npm run lint
- name: Test Components
env:
VITE_AZURE_ACTIVE_DIRECTORY_CLIENT_ID: '11111111-2222-3333-4444-555555555dev'
# IMPORTANT: A valid Azure AD Tenant ID for testing purposes is required.
VITE_AZURE_ACTIVE_DIRECTORY_TENANT_ID: 'common'
run: npm run test
- name: Build Application
run: npm run build

0 comments on commit 13e8b74

Please sign in to comment.