Bump for security vulnerabilities #1194
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: Test the tests | |
on: | |
push: | |
workflow_dispatch: | |
inputs: | |
extra_languages: | |
required: False | |
description: 'Optional. A list of comma separated language names visible on buttons or links that change the language of the interview. Overrides the EXTRA_LANGUAGES repo secret.' | |
default: '' | |
tags: | |
required: False | |
description: 'Optional. Use a "tag expression" specify which tagged tests to run (https://cucumber.io/docs/cucumber/api/#tag-expressions)' | |
default: '' | |
jobs: | |
puppeteer-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [17.x] | |
env: | |
BASE_URL: ${{ secrets.SERVER_URL }} | |
PLAYGROUND_EMAIL: ${{ secrets.PLAYGROUND_EMAIL }} | |
PLAYGROUND_PASSWORD: ${{ secrets.PLAYGROUND_PASSWORD }} | |
PLAYGROUND_ID: ${{ secrets.PLAYGROUND_ID }} | |
DOCASSEMBLE_DEVELOPER_API_KEY: ${{ secrets.DOCASSEMBLE_DEVELOPER_API_KEY }} | |
EXTRA_LANGUAGES: ${{ secrets.EXTRA_LANGUAGES }} | |
USER1_EMAIL: ${{ secrets.USER1_EMAIL }} | |
USER1_PASSWORD: ${{ secrets.USER1_PASSWORD }} | |
SECRET_VAR1: secret-var1-value | |
SECRET_VAR2: secret-var2-value | |
SECRET_FOR_MISSING_FIELD: secret for missing field | |
name: Run Puppeteer tests | |
steps: | |
- name: Set Github-related environment variables | |
run: | | |
echo "REPO_URL=${{ github.server_url }}/${{ github.repository }}" >> $GITHUB_ENV | |
echo "BRANCH_PATH=${{ github.ref }}" >> $GITHUB_ENV | |
- name: Set name of artifact folder with date and UTC time | |
# https://www.shell-tips.com/linux/how-to-format-date-and-time-in-linux-macos-and-bash/#how-to-format-a-date-in-bash | |
run: | | |
echo "ARTIFACT_NAME=alkiln-$(date +'%Y-%m-%d at %Hh%Mm%Ss' -u)UTC" >> $GITHUB_ENV | |
echo "UNIT_TESTS_ARTIFACT_NAME=_alkiln-misc-$(date +'%Y-%m-%d at %Hh%Mm%Ss' -u)UTC" >> $GITHUB_ENV | |
- name: Set languages | |
run: echo "EXTRA_LANGUAGES=${{ github.event.inputs.extra_languages }}" >> $GITHUB_ENV | |
if: ${{ github.event.inputs.extra_languages != '' }} | |
# For the testing repo, the `REPO_URL` is that of a different repo and is created in `env:` | |
- run: echo "Repo address is $REPO_URL" | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup environment | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: npm install | |
- run: npm run setup | |
- run: npm run test -- ${{ github.event.inputs.tags && format('"--tags" "{0}"', github.event.inputs.tags) }} | |
# Artifacts | |
- name: upload unit tests artifacts folder | |
uses: actions/upload-artifact@v2 | |
# This will upload even if a previous step has failed | |
if: ${{ always() }} | |
with: | |
name: ${{ env.UNIT_TESTS_ARTIFACT_NAME }} | |
path: ./_alkiln-* | |
- name: upload integration tests artifacts folder | |
uses: actions/upload-artifact@v2 | |
if: ${{ always() }} | |
with: | |
name: ${{ env.ARTIFACT_NAME }} | |
path: ./alkiln-* | |
# Delete Playground Project and project name file | |
- name: Cleanup | |
if: ${{ always() }} | |
run: npm run takedown |