|
| 1 | +name: E2E Smoke Tests |
| 2 | + |
| 3 | +# Allows REST trigger. Currently triggered by release-cli script during a staging run. |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + versionOrTag: |
| 8 | + description: 'release version or tag' |
| 9 | + required: true |
| 10 | + default: 'next' |
| 11 | + |
| 12 | +jobs: |
| 13 | + test: |
| 14 | + name: Run E2E Smoke Tests |
| 15 | + runs-on: ubuntu-latest |
| 16 | + defaults: |
| 17 | + run: |
| 18 | + # Run any command steps in the /e2e subdir |
| 19 | + working-directory: './e2e' |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Checkout Repo |
| 23 | + uses: actions/checkout@master |
| 24 | + - name: Set up Node (12) |
| 25 | + uses: actions/setup-node@v2 |
| 26 | + with: |
| 27 | + node-version: 12.x |
| 28 | + - name: install Chrome stable |
| 29 | + run: | |
| 30 | + sudo apt-get update |
| 31 | + sudo apt-get install google-chrome-stable |
| 32 | + - name: Bump Node memory limit |
| 33 | + run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV |
| 34 | + - name: Write project config |
| 35 | + env: |
| 36 | + PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }} |
| 37 | + TEST_ACCOUNT: ${{ secrets.TEST_ACCOUNT }} |
| 38 | + run: | |
| 39 | + echo "export const config = $PROJECT_CONFIG; export const testAccount = $TEST_ACCOUNT" > firebase-config.js |
| 40 | + - name: Yarn install |
| 41 | + run: | |
| 42 | + echo "Installing firebase@${{ github.event.inputs.versionOrTag }}" |
| 43 | + yarn add firebase@${{ github.event.inputs.versionOrTag }} |
| 44 | + yarn |
| 45 | + - name: Deploy "callTest" cloud function |
| 46 | + run: | |
| 47 | + pushd functions |
| 48 | + npm install |
| 49 | + popd |
| 50 | + npx firebase-tools deploy --only functions:callTest --project jscore-sandbox-141b5 --token $FIREBASE_CLI_TOKEN |
| 51 | + working-directory: ./config |
| 52 | + env: |
| 53 | + FIREBASE_CLI_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }} |
| 54 | + - name: Run modular tests |
| 55 | + env: |
| 56 | + APP_CHECK_DEBUG_TOKEN: ${{ secrets.APP_CHECK_DEBUG_TOKEN }} |
| 57 | + run: xvfb-run yarn test:modular |
| 58 | + - name: Run compat tests |
| 59 | + env: |
| 60 | + APP_CHECK_DEBUG_TOKEN: ${{ secrets.APP_CHECK_DEBUG_TOKEN }} |
| 61 | + run: xvfb-run yarn test:compat |
| 62 | + - name: Tests succeeded |
| 63 | + if: success() |
| 64 | + run: node scripts/ci/notify-test-result.js success |
| 65 | + env: |
| 66 | + WEBHOOK_URL: ${{ secrets.JSCORE_CHAT_WEBHOOK_URL }} |
| 67 | + # run in root |
| 68 | + working-directory: '.' |
| 69 | + - name: Tests failed |
| 70 | + if: failure() |
| 71 | + run: node scripts/ci/notify-test-result.js fail |
| 72 | + env: |
| 73 | + WEBHOOK_URL: ${{ secrets.JSCORE_CHAT_WEBHOOK_URL }} |
| 74 | + # run in root |
| 75 | + working-directory: '.' |
0 commit comments