Skip to content

Commit

Permalink
Consistent GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
obany committed Dec 1, 2023
1 parent 1d2407c commit 636bb14
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 28 deletions.
31 changes: 26 additions & 5 deletions .github/workflows/automation-testing-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,68 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node 16

- name: Setup Node 18
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Packages
run: |
npm install
node-version: 18
registry-url: https://registry.npmjs.org
scope: '@openfin'

- name: Restore root node_modules from cache
id: node-cache
uses: actions/cache@v3
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm ci

- name: Run JavaScript Tests with Mocha
run: |
npx fkill-cli OpenFin OpenFinRVM --force --silent
npm run test-remote-mocha --prefix how-to/automation-testing/register-with-home-js
- name: Run WDIO tests
run: |
npm run kill --prefix how-to/automation-testing/wdio
npm run dos --prefix how-to/automation-testing/wdio
npm run test --prefix how-to/automation-testing/wdio
- name: Run Selenium tests
run: |
npm run kill --prefix how-to/automation-testing/selenium
npm run dos --prefix how-to/automation-testing/selenium
npm run test --prefix how-to/automation-testing/selenium
- name: Run JavaScript Tests with Jasmine
run: |
npx fkill-cli OpenFin OpenFinRVM --force --silent
npm run test-remote-jasmine --prefix how-to/automation-testing/register-with-home-js
- name: Run JavaScript Tests with Jest
run: |
npx fkill-cli OpenFin OpenFinRVM --force --silent
npm run test-remote-jest --prefix how-to/automation-testing/register-with-home-js
- name: Run TypeScript Tests with Mocha
run: |
npx fkill-cli OpenFin OpenFinRVM --force --silent
npm run test-remote-mocha --prefix how-to/automation-testing/register-with-home-ts
- name: Run TypeScript Tests with Jasmine
run: |
npx fkill-cli OpenFin OpenFinRVM --force --silent
npm run test-remote-jasmine --prefix how-to/automation-testing/register-with-home-ts
- name: Run TypeScript Tests with Jest
run: |
npx fkill-cli OpenFin OpenFinRVM --force --silent
npm run test-remote-jest --prefix how-to/automation-testing/register-with-home-ts
- name: Run JavaScript Tests with Mocha for Store
run: |
npx fkill-cli OpenFin OpenFinRVM --force --silent
Expand Down
23 changes: 18 additions & 5 deletions .github/workflows/automation-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,26 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node 16

- name: Setup Node 18
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Packages
run: |
npm install
node-version: 18
registry-url: https://registry.npmjs.org
scope: '@openfin'

- name: Restore root node_modules from cache
id: node-cache
uses: actions/cache@v3
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm ci

- name: Run JavaScript Tests with Mocha
run: |
npx fkill-cli OpenFin OpenFinRVM --force --silent
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Workspace Platform Starter - E2E Tests

on: workflow_dispatch

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node 18
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org
scope: '@openfin'

- name: Restore root node_modules from cache
id: node-cache
uses: actions/cache@v3
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm ci

- name: Run Workspace Platform Starter E2E Tests
working-directory: ./how-to/workspace-platform-starter
run: npm run e2e
16 changes: 8 additions & 8 deletions .github/workflows/publish-HOWTOs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js
- name: Setup Node 18
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
registry-url: https://registry.npmjs.org
scope: '@openfin'

- name: Install dependencies
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm ci

- name: Restore root node_modules from cache
id: node-cache
uses: actions/cache@v3
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
key: node-modules-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm ci

- name: Build packages
run: npm run build
Expand Down
30 changes: 24 additions & 6 deletions .github/workflows/publish-NPM.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,34 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node 18
uses: actions/setup-node@v3
with:
node-version: '19'
registry-url: 'https://registry.npmjs.org'
- run: npm run setup
node-version: 18
registry-url: https://registry.npmjs.org
scope: '@openfin'

- name: Restore root node_modules from cache
id: node-cache
uses: actions/cache@v3
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm ci

- run: npm run build
working-directory: ./how-to/workspace-platform-starter

- run: NAME=@openfin/default-workspace-platform npm run prepare-package
working-directory: ./how-to/workspace-platform-starter

- run: npm publish --access restricted
working-directory: ./how-to/workspace-platform-starter/packaged
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check Tests run
name: Workspace Platform Starter - Unit Tests

on:
pull_request:
Expand Down
8 changes: 5 additions & 3 deletions how-to/workspace-platform-starter/e2e/tests/platform.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ describe("Platform", () => {
expect(isReady).toEqual(true);
});

it("The title should be set", async () => {
const title = await WebDriver.getTitle();
expect(title).toEqual("Platform Provider");
it("The platform title should be set", async () => {
const windows = await WebDriver.getWindows();
expect(windows.length).toBeGreaterThan(0);
const titles = windows.map((w) => w.title);
expect(titles).toContain("Platform Provider");
});

it("The runtime version should be set", async () => {
Expand Down

0 comments on commit 636bb14

Please sign in to comment.