From f1f9a1edb7da4b1cc520fc5f70d2595b1b789dd3 Mon Sep 17 00:00:00 2001 From: Christian Cook <3473396+CookieCookson@users.noreply.github.com> Date: Sat, 20 Mar 2021 12:18:30 +0000 Subject: [PATCH] update workflows to run e2e tests simultaneously (#155) --- .github/workflows/test-pr.yml | 2 +- .github/workflows/test-push-to-master.yml | 67 ++++++++++++++++++++--- README.md | 2 +- 3 files changed, 60 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index ede74ee..f5aebc9 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -1,7 +1,7 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Node.js CI +name: Pull Request Checks on: pull_request: diff --git a/.github/workflows/test-push-to-master.yml b/.github/workflows/test-push-to-master.yml index a3138f5..777a712 100644 --- a/.github/workflows/test-push-to-master.yml +++ b/.github/workflows/test-push-to-master.yml @@ -1,7 +1,7 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Node.js CI +name: E2E Tests on: push: @@ -10,29 +10,78 @@ on: jobs: build: runs-on: ubuntu-latest - strategy: matrix: node-version: [12.x] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Install Dependencies + run: npm ci + - name: Check Prettier Formatting + run: npm run test:format + - name: Run ESLint + run: npm run lint + - name: Run Unit Tests + run: npm run test + - name: Build + run: npm run build --if-present + - name: Cache Build + uses: actions/cache@v2 + id: restore-build + with: + path: ./* + key: ${{ github.sha }} + test-e2e-scorm-cloud: + needs: build + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [12.x] steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - run: npm ci - - run: npm run test:format - - run: npm run lint - - run: npm run test - - run: npm run build --if-present - - run: npm run test:e2e + - name: Restore Build + uses: actions/cache@v2 + id: restore-build + with: + path: ./* + key: ${{ github.sha }} + - name: Run e2e tests against SCORM Cloud LRS + run: npm run test:e2e env: CI: true LRS_ENDPOINT: ${{ secrets.LRS_ENDPOINT_SCORMCLOUD }} LRS_USERNAME: ${{ secrets.LRS_USERNAME_SCORMCLOUD }} LRS_PASSWORD: ${{ secrets.LRS_PASSWORD_SCORMCLOUD }} - - run: npm run test:e2e + + test-e2e-veracity-learning: + needs: build + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [12.x] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Restore Build + uses: actions/cache@v2 + id: restore-build + with: + path: ./* + key: ${{ github.sha }} + - name: Run e2e tests against Veracity Learning LRS + run: npm run test:e2e env: CI: true LRS_ENDPOINT: ${{ secrets.LRS_ENDPOINT_VERACITY }} diff --git a/README.md b/README.md index 1e4acd5..b76bac2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Node.js CI](https://github.com/xapijs/xapi/workflows/Node.js%20CI/badge.svg) +[![npm version](https://img.shields.io/npm/v/@xapi/xapi.svg)](https://www.npmjs.com/package/@xapi/xapi) [![E2E Tests](https://github.com/xapijs/xapi/workflows/E2E%20Tests/badge.svg)](https://github.com/xapijs/xapi/actions/workflows/test-push-to-master.yml) [xAPI.js logo](https://www.xapijs.dev)