Skip to content

Commit

Permalink
update workflows to run e2e tests simultaneously (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
CookieCookson authored Mar 20, 2021
1 parent f84c514 commit f1f9a1e
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
67 changes: 58 additions & 9 deletions .github/workflows/test-push-to-master.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)

[<img width="100" src="https://avatars3.githubusercontent.com/u/65084607?s=200&v=4" alt="xAPI.js logo">](https://www.xapijs.dev)

Expand Down

0 comments on commit f1f9a1e

Please # to comment.