Skip to content

Commit

Permalink
Revert "Setup CI/CD for lint, vitest and cypress tests"
Browse files Browse the repository at this point in the history
This reverts commit 509bd2a.
  • Loading branch information
kvestus committed Feb 19, 2024
1 parent 509bd2a commit e6dee82
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 49 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/build.yml

This file was deleted.

64 changes: 62 additions & 2 deletions .github/workflows/e2e-tests.yml → .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,58 @@
name: E2E Tests
name: Main

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
container:
image: cypress/browsers:node-18.16.0-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1
options: --user 1001
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Cache node_modules
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'

- name: Cypress install
uses: cypress-io/github-action@v6
with:
runTests: false

- name: Write Firebase config
run: |
echo ${{ secrets.FIREBASE_CONFIG }} | base64 -d > firebase.config.json
- run: npx cypress info
- run: node --version
- run: node -p 'os.cpus()'
- run: npm run lint
- run: npm run test:ci
- run: npm run build

- name: Save build folder
uses: actions/upload-artifact@v4
with:
name: dist
if-no-files-found: error
path: dist

e2e-chrome-tests:
uses: ./.github/workflows/build.yml
timeout-minutes: 15
runs-on: ubuntu-latest
container:
image: cypress/browsers:node-18.16.0-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1
options: --user 1001
needs: build
strategy:
fail-fast: false # https://github.com/cypress-io/github-action/issues/48
matrix:
Expand Down Expand Up @@ -105,3 +145,23 @@ jobs:
TEST_USER_USERNAME: ${{ secrets.TEST_USER_USERNAME_2 }}
TEST_USER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD_2 }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

deploy_live_website:
name: Deploy Prod
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@main
- name: Download artifact
uses: actions/download-artifact@main
with:
name: dist
path: dist
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}"
projectId: "${{ secrets.GOOGLE_PROJECT_ID }}"
channelId: live

0 comments on commit e6dee82

Please sign in to comment.