Skip to content

Commit

Permalink
Remove package.json script dependencies from workflow files (#738)
Browse files Browse the repository at this point in the history
* Removed "test:functional:ci:prod" from package.json.

* Add sauce configuration override.
  • Loading branch information
shammowla committed Jun 4, 2021
1 parent b4559c3 commit 922fe61
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 31 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ on:
push:
workflow_dispatch:
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_JOB: "Alloy Dev Workflow"
SAUCE_CAPABILITIES_OVERRIDES_PATH: 'sauceLabsCapabilities.json'
EDGE_BASE_PATH: ee-pre-prd
ALLOY_ENV: int
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_JOB: "Alloy Dev Workflow"
SAUCE_CAPABILITIES_OVERRIDES_PATH: 'sauceLabsCapabilities.json'
EDGE_BASE_PATH: ee-pre-prd
ALLOY_ENV: int

jobs:
unit-test:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pre-deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Pre-Deploy
on: workflow_dispatch
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_JOB: "Alloy Pre-Deploy Workflow"
SAUCE_CAPABILITIES_OVERRIDES_PATH: 'sauceLabsCapabilities.json'
ALLOY_ENV: int
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_JOB: "Alloy Pre-Deploy Workflow"
SAUCE_CAPABILITIES_OVERRIDES_PATH: 'sauceLabsCapabilities.json'
ALLOY_ENV: int

jobs:
e2e-test:
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/pre-edge-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ on:
required: true
default: 'warning'
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_CAPABILITIES_OVERRIDES_PATH: 'sauceLabsCapabilities.json'
ALLOY_ENV: prod
EDGE_BASE_PATH: ee-pre-prd

SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_CAPABILITIES_OVERRIDES_PATH: 'sauceLabsCapabilities.json'
ALLOY_ENV: prod
EDGE_BASE_PATH: ee-pre-prd
jobs:
alloy-prod-e2e:
name: "Pre Edge: Prod E2E Tests"
Expand All @@ -27,6 +26,9 @@ jobs:
- uses: actions/[email protected]
with:
ref: ${{ steps.last_release.outputs.tag_name }}
- name: Get version from package
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- uses: actions/cache@v2
id: npm-cache
with:
Expand All @@ -38,6 +40,6 @@ jobs:
- name: Build
run: npm run test:functional:build:prod
- name: Run TestCafe Tests
run: npm run test:functional:ci:prod
run: npx testcafe -q -c 5 'saucelabs:Chrome@latest:macOS 11.00','saucelabs:IE@latest:Windows 10','saucelabs:Firefox@latest:Windows 10','saucelabs:Safari@latest:macOS 11.00'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ALLOY_PROD_VERSION: ${{ steps.package-version.outputs.current-version }}
21 changes: 12 additions & 9 deletions .github/workflows/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ on:
schedule:
- cron: "0 */24 * * *"
workflow_dispatch:
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_JOB: "Alloy Prod Workflow"
SAUCE_CAPABILITIES_OVERRIDES_PATH: 'sauceLabsCapabilities.json'
ALLOY_ENV: prod

jobs:
get-testing-tags:
Expand Down Expand Up @@ -40,6 +34,13 @@ jobs:
matrix: ${{ fromJSON(needs.get-testing-tags.outputs.matrixInput) }}
needs: get-testing-tags
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_CAPABILITIES_OVERRIDES_PATH: 'sauceLabsCapabilities.json'
SAUCE_JOB: "Alloy Prod Workflow"
ALLOY_ENV: prod
steps:
- name: Create a workflow dispatch event with ${{ matrix.tag }}
uses: actions/[email protected]
Expand All @@ -50,16 +51,18 @@ jobs:
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
- name: Get version from package
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- name: Build
run: npm run test:functional:build:prod
- name: Run TestCafe Tests
run: npm run test:functional:ci:prod -- -q -c 5 'saucelabs:Chrome@latest:macOS 11.00','saucelabs:IE@latest:Windows 10','saucelabs:Firefox@latest:Windows 10','saucelabs:Safari@latest:macOS 11.00'
run: npx testcafe -q -c 5 'saucelabs:Chrome@latest:macOS 11.00','saucelabs:IE@latest:Windows 10','saucelabs:Firefox@latest:Windows 10','saucelabs:Safari@latest:macOS 11.00'
env:
ALLOY_PROD_VERSION: ${{ matrix.tag }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ALLOY_PROD_VERSION: ${{ steps.package-version.outputs.current-version }}
- uses: craftech-io/slack-action@v1
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-to-npm.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Publish To NPM
on: workflow_dispatch
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}

jobs:
publish-to-npm:
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"test:unit:saucelabs:local": "karma start karma.saucelabs.conf.js --single-run",
"test:unit:coverage": "karma start --single-run --reporters spec,coverage",
"test:functional": "EDGE_BASE_PATH=\"ee-pre-prd\" ALLOY_ENV=\"int\" testcafe chrome",
"test:functional:ci:prod": "SAUCE_CAPABILITIES_OVERRIDES_PATH=\"sauceLabsCapabilities.json\" testcafe",
"test:functional:watch": "EDGE_BASE_PATH=\"ee-pre-prd\" ALLOY_ENV=\"int\" ./scripts/watchFunctionalTests.js --browsers chrome",
"test:functional:build:int": "rollup -c --environment BASE_CODE_MIN,STANDALONE,NPM_PACKAGE_LOCAL",
"test:functional:build:prod": "rollup -c --environment BASE_CODE_MIN,NPM_PACKAGE_PROD",
Expand Down

0 comments on commit 922fe61

Please sign in to comment.