diff --git a/.github/workflows/tests_and_qc_frontend.yml b/.github/workflows/test_frontend_e2e_live.yml similarity index 91% rename from .github/workflows/tests_and_qc_frontend.yml rename to .github/workflows/test_frontend_e2e_live.yml index 6d9c682aa..eeae2941e 100644 --- a/.github/workflows/tests_and_qc_frontend.yml +++ b/.github/workflows/test_frontend_e2e_live.yml @@ -1,7 +1,7 @@ # TODO: 1. run local: (i) start backend (a) local backend in GH action, or (b) use dev's backend URL (won't always work), (ii) set to on:pr&push # TODO: 2. after '1': expose params to workflow_dispatch: so can choose which env we want to test, in case we don't want to run all 3 at once -name: Tests and QC - Frontend +name: Test - Frontend deployments - End to end on: workflow_dispatch: schedule: @@ -20,23 +20,24 @@ jobs: with: node-version: 18 - # cache: 'yarn' # Enable yarn cache + # Yarn Setup + # cache: 'yarn' # Enable yarn cache # manual caching steps - name: get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v3 with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('frontend/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - - name: Install dependencies -# run: cd frontend && npm ci # only playwright is necessary to install + # run: cd frontend && npm ci # only playwright is necessary to install run: yarn install --frozen-lockfile # Equivalent to npm ci working-directory: frontend + + # Playwright setup - name: Install Playwright browsers run: yarn playwright install --with-deps # Use yarn to run playwright install working-directory: frontend @@ -44,6 +45,8 @@ jobs: run: | sed -n '/webServer: \[/,/\]/!p' playwright.config.js > tmp && mv tmp playwright.config.js working-directory: frontend + + # Run tests - name: Run Playwright tests run: make test-frontend-deployments - uses: actions/upload-artifact@v3 @@ -53,7 +56,6 @@ jobs: path: frontend/playwright-report/ retention-days: 30 - #name: Playwright Tests #on: # push: @@ -81,4 +83,4 @@ jobs: # with: # name: playwright-report # path: playwright-report/ -# retention-days: 30 \ No newline at end of file +# retention-days: 30 diff --git a/.github/workflows/test_frontend_unit_and_qc.yml b/.github/workflows/test_frontend_unit_and_qc.yml new file mode 100644 index 000000000..9b6fef1b2 --- /dev/null +++ b/.github/workflows/test_frontend_unit_and_qc.yml @@ -0,0 +1,37 @@ +name: Test - Frontend - Unit tests and QC +on: + workflow_dispatch: + push: + branches: [ main, develop ] + pull_request: + branches: [ main, develop ] +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + + # Yarn Setup + # cache: 'yarn' # Enable yarn cache + # manual caching steps + - name: get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v3 + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('frontend/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install dependencies + # run: cd frontend && npm ci # only playwright is necessary to install + run: yarn install --frozen-lockfile # Equivalent to npm ci + working-directory: frontend + + # Run tests + - name: Run tests + run: echo todo - make tests