Create github actions for build, e2e-tests and deploy #139
Workflow file for this run
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
name: Pull request | |
on: | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
timeout-minutes: 3 | |
runs-on: ubuntu-latest | |
container: | |
image: cypress/browsers:node18.12.0-chrome106-ff106 | |
options: --user 1001 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Cache dependencies | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: ./node_modules | |
key: modules-${{ hashFiles('package-lock.json') }} | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Write Firebase config | |
run: | | |
echo ${{ secrets.FIREBASE_CONFIG_BASE64 }} | base64 -d > firebase.config.json | |
- run: node --version | |
- run: node -p 'os.cpus()' | |
- run: npm run build | |
- run: npm run lint | |
- run: npm run test:ci | |
- run: npm run build:test | |
- name: Save build folder | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
if-no-files-found: error | |
path: dist | |
- name: Save test build folder | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-test | |
if-no-files-found: error | |
path: dist-test | |
e2e-chrome-tests: | |
needs: build | |
uses: ./.github/workflows/e2e-tests.yml | |
with: | |
isManual: true | |
platform: desktop | |
secrets: | |
TEST_USER_USERNAME: ${{ secrets.TEST_USER_USERNAME_1 }} | |
TEST_USER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD_1 }} | |