Skip to content

Commit

Permalink
fix: update workflow comments and add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
NishaSharma14 committed Mar 16, 2023
1 parent 66609ba commit 05d5e62
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 36 deletions.
40 changes: 33 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,29 @@ env:
IMAGE: nmrium

jobs:
e2etest:
runs-on: ubuntu-latest
strategy:
matrix:
project: [chromium, firefox, webkit]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Install dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install --with-deps
- name: Build test application
env:
NODE_OPTIONS: '--max_old_space_size=4096'
run: npm run build-no-minify
- name: Run E2E tests on ${{ matrix.project }}
run: npx playwright test --project ${{ matrix.project }}
continue-on-error: ${{ matrix.project == 'webkit' }}

lint:
runs-on: ubuntu-latest
steps:
Expand All @@ -30,38 +53,41 @@ jobs:
run: npm run check-types

setup-build-publish-deploy-dev:
name: deploy to dev
name: Deploy to dev
if: github.ref == 'refs/heads/development'
runs-on: ubuntu-latest
needs: lint
needs: [lint, e2etest]
steps:
- name: Checkout
uses: actions/checkout@v2

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
- name: Setup CLI
uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}

# Configure docker to use the gcloud command-line tool as a credential helper
- run: |-
- name: Configure docker
run: |-
gcloud auth configure-docker europe-west3-docker.pkg.dev
# Get the GKE credentials so we can deploy to the cluster
- uses: google-github-actions/get-gke-credentials@v0.3.0
- name: Get GKE credentials
uses: google-github-actions/get-gke-credentials@v0.3.0
with:
cluster_name: ${{ env.GKE_CLUSTER_DEV }}
location: ${{ env.GKE_ZONE }}
credentials: ${{ secrets.GKE_SA_KEY }}

# Build the Docker image
- name: Build Image
- name: Build docker image
run: |-
docker build -f Dockerfile.prod --tag europe-west3-docker.pkg.dev/$PROJECT_ID/$REPOSITORY_NAME_DEV/$IMAGE:latest .
# Push the Docker image to Google Artifact Registry
- name: Publish Image to Google Artifact Registry
- name: Publish image to Google Artifact Registry
run: |-
docker push "europe-west3-docker.pkg.dev/$PROJECT_ID/$REPOSITORY_NAME_DEV/$IMAGE:latest"
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/e2e.yml

This file was deleted.

0 comments on commit 05d5e62

Please sign in to comment.