Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 13126-long-text-for-c…
Browse files Browse the repository at this point in the history
…omponent--id-in-expression-cause-overfloww
  • Loading branch information
JamalAlabdullah committed Jul 15, 2024
2 parents ff736ad + c89baa5 commit 68d373c
Show file tree
Hide file tree
Showing 467 changed files with 4,729 additions and 1,301 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/build-image-on-pr.yaml

This file was deleted.

38 changes: 20 additions & 18 deletions .github/workflows/frontend-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,27 @@ name: Frontend Tests

on:
push:
branches:
- main
paths:
- 'frontend/**'
- '!frontend/testing/cypress/**'
- '!frontend/stats/**'
- 'testdata/**'
- '.github/workflows/frontend-unit-tests.yml'
- 'package.json'
pull_request:
paths:
- 'frontend/**'
- '!frontend/testing/cypress/**'
- '!frontend/stats/**'
- 'testdata/**'
- '.github/workflows/frontend-unit-tests.yml'
- 'package.json'
workflow_dispatch:

concurrency:
group: ${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
Expand Down Expand Up @@ -63,7 +74,7 @@ jobs:
run: yarn typecheck

- name: 'Running Eslint'
run: yarn lint
run: yarn lint --cache

- name: 'Checking code style'
run: yarn run codestyle:check
Expand All @@ -81,7 +92,13 @@ jobs:
uses: ./.github/actions/yarn-install

- name: 'Running Unit Tests'
run: yarn test:ci
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
git fetch origin ${{ github.event.pull_request.base.ref }}
yarn test:ci --changedSince=origin/${{ github.event.pull_request.base.ref }}
else
yarn test:ci
fi
- name: 'Upload coverage reports to Codecov'
uses: codecov/codecov-action@v4
Expand All @@ -90,18 +107,3 @@ jobs:
with:
directory: frontend/coverage
fail_ci_if_error: true

build:
name: 'Building'
runs-on: ubuntu-latest
steps:
- name: 'Checking Out Code'
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 'Installing Dependencies'
uses: ./.github/actions/yarn-install

- name: 'Building'
run: yarn build
51 changes: 51 additions & 0 deletions .github/workflows/helm-chart-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Eid logger helm build and push
on:
push:
branches: [ main ]
paths:
- 'eidlogger/**'
- '.github/workflows/helm-chart-push.yaml'
- 'charts/eid-logger/**'
workflow_dispatch:

permissions:
id-token: write
contents: read

jobs:
helm-build-push:
name: Helm build and push
runs-on: ubuntu-latest
env:
REGISTRY: altinntjenestercontainerregistry.azurecr.io
REPOSITORY: eid-logger
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID_FC }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID_FC }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID_FC }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: 'Azure login'
uses: azure/login@v2
with:
client-id: ${{ env.AZURE_CLIENT_ID }}
tenant-id: ${{ env.AZURE_TENANT_ID }}
subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }}

- name: 'Install helm'
uses: azure/[email protected]
with:
version: '3.15.3'
id: install

- name: Log in to Container registry
run: |
az acr login --name ${{ env.REGISTRY }} --expose-token --output tsv --query accessToken --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID_FC }} --only-show-errors | helm registry login ${{ env.REGISTRY }} --username 00000000-0000-0000-0000-000000000000 --password-stdin
- name: Helm build
run: |
helm package charts/eid-logger --version 0.1.0+${{ github.sha }}
- name: Helm push
run: |
helm push eid-logger-0.1.0+${{ github.sha }}.tgz oci://${{ env.REGISTRY }}/charts
72 changes: 72 additions & 0 deletions .github/workflows/playwright-resourceadm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Resourceadm Playwright Tests in Dev

on:
push:
branches:
- main
paths:
- 'frontend/resourceadm/**'
- '.github/workflows/playwright-resourceadm.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
playwright-run:
name: 'Resourceadm Playwright Tests'
runs-on: ubuntu-latest

steps:
- name: 'Checking Out Code'
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
cache: 'yarn'

- name: Get yarn cache directory path
working-directory: frontend
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Attempt to wait for deploy to environment (15 minutes sleep)
run: |
if [ "${{ github.run_attempt }}" != "1" ]; then
echo "Skip waiting for deploy, since this is a re-run of the pipeline."
else
sleep 15m
fi
- name: Resourceadm Playwright run
working-directory: frontend/resourceadm/testing/playwright
env:
PLAYWRIGHT_TEST_BASE_URL: 'https://dev.altinn.studio'
PLAYWRIGHT_RESOURCES_ORGANIZATION: ttd
PLAYWRIGHT_RESOURCES_REPO_NAME: ttd-resources
PLAYWRIGHT_USER: 'AutoTest'
PLAYWRIGHT_PASS: ${{ secrets.AUTO_TEST_USER_PWD }}
GITEA_ACCESS_TOKEN: ${{ secrets.AUTO_TEST_USER_TOKEN_DEV }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
yarn
yarn install --immutable --inline-builds
yarn playwright install --with-deps
yarn resourceadm:playwright:test:all
- name: Store artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-resourceadm-screenshots
path: frontend/resourceadm/testing/playwright/test-results
25 changes: 9 additions & 16 deletions .github/workflows/run-playwright-on-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,25 @@ on:
- 'development/**'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
playwright-tests:
name: Build environment and run e2e test
timeout-minutes: 25
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: 'Checking Out Code'
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 'Installing Dependencies'
uses: ./.github/actions/yarn-install

- name: Generate .env file
run: |
echo PLAYWRIGHT_TEST_APP=autodeploy-v3 >> .env
Expand All @@ -43,15 +51,6 @@ jobs:
echo COMMIT= >> .env
echo IGNORE_DOCKER_DNS_LOOKUP=true >> .env
- name: Build all images
run: |
docker compose build --no-cache
- name: Install node
uses: actions/setup-node@v4
with:
cache: 'yarn'

- name: Run setup.js script
run: |
node ./development/setup.js
Expand All @@ -61,15 +60,9 @@ jobs:
env:
environment: local
run: |
yarn
yarn playwright install --with-deps
yarn setup:playwright
yarn playwright:test:all
- name: Stop compose file
if: always()
run: docker-compose down

- name: Store artifacts
uses: actions/upload-artifact@v4
if: failure()
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/run-playwright-resourceadm-on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Resource admin playwright tests on pr
on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened]
paths:
- 'frontend/resourceadm/**'
- '.github/workflows/run-playwright-resourceadm-on-pr.yaml'
workflow_dispatch:

jobs:
playwright-tests:
name: Build environment and run e2e test
timeout-minutes: 25
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate .env file
run: |
echo PLAYWRIGHT_TEST_APP=autodeploy-v3 >> .env
echo DEVELOP_APP_DEVELOPMENT=0 >> .env
echo DEVELOP_RESOURCE_ADMIN=0 >> .env
echo DEVELOP_BACKEND=0 >> .env
echo DEVELOP_DASHBOARD=0 >> .env
echo DEVELOP_PREVIEW=0 >> .env
echo GITEA_ADMIN_PASS=g9wDIG@6gf >> .env
echo GITEA_ADMIN_USER=localg1iteaadmin >> .env
echo GITEA_CYPRESS_USER=cypress_testuser >> .env
echo GITEA_CYPRESS_PASS=g9wDIG@6gf >> .env
echo GITEA_ORG_USER=ttd >> .env
echo POSTGRES_PASSWORD=kyeDIG@eip >> .env
echo COMMIT= >> .env
echo IGNORE_DOCKER_DNS_LOOKUP=true >> .env
- name: Build all images
run: |
docker compose build --no-cache
- name: Install node
uses: actions/setup-node@v4
with:
cache: 'yarn'

- name: Run setup.js script
run: |
node ./development/setup.js
- name: Playwright resourceadm run
working-directory: frontend/resourceadm/testing/playwright
env:
environment: local
run: |
yarn
yarn playwright install --with-deps
yarn resourceadm:setup:playwright
yarn resourceadm:playwright:test:all
- name: Stop compose file
if: always()
run: docker-compose down

- name: Store artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-resourceadm-screenshots
path: frontend/testing/playwright/test-results
Loading

0 comments on commit 68d373c

Please sign in to comment.