-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(github): add workflow to build and test application on each push
- Loading branch information
1 parent
412eb3d
commit 13e8b74
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |