Skip to content

Commit

Permalink
try out GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent committed Jan 26, 2024
1 parent 439364e commit cae571b
Show file tree
Hide file tree
Showing 13 changed files with 115 additions and 183 deletions.
10 changes: 10 additions & 0 deletions .github/commonSteps/checkoutAndInstallLibs.steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install --legacy-peer-deps
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
13 changes: 13 additions & 0 deletions .github/commonSteps/checkoutAndInstallLibs.web.steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: shivammathur/setup-php@v2
with:
php-version: 7.4
- run: npm install --legacy-peer-deps
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
10 changes: 10 additions & 0 deletions .github/commonSteps/playwright.steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
steps:
- name: npm install
run: |
npm install --legacy-peer-deps
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
- name: Install browsers and deps
run: npx playwright install && npx playwright install-deps
- name: start a server
run: "php -S 127.0.0.1:8000 -t test/data/app &"
32 changes: 32 additions & 0 deletions .github/workflows/appiumV2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Appium V2 Tests

on:
push:
branches:
- 3.x
- consolidate-test-env-in-gha

env:
CI: true
# Force terminal colors. @see https://www.npmjs.com/package/colors
FORCE_COLOR: 1
NODE_VERSION: 20.x
PLATFORM: ubuntu-22.04
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}

jobs:
AppiumTests:
runs-on: $PLATFORM

strategy:
matrix:
node-version: [$NODE_VERSION]
test-suite: ['appium-quick', 'appium-other', 'ios:appium-quick', 'ios:appium-other']

steps:
- name: Appium common steps
uses: ./.github/commonSteps/checkoutAndInstallLibs.steps.yml

- name: Run Appium Tests
run: npm run test:${{ matrix.test-suite }}
58 changes: 0 additions & 58 deletions .github/workflows/appiumV2_Android.yml

This file was deleted.

58 changes: 0 additions & 58 deletions .github/workflows/appiumV2_iOS.yml

This file was deleted.

14 changes: 3 additions & 11 deletions .github/workflows/doc-generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,11 @@ jobs:

strategy:
matrix:
node-version: [ 18.x ]
node-version: [ 20.x ]

steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm install --legacy-peer-deps
- name: Checkout and install dependencies steps
uses: ./.github/commonSteps/checkoutAndInstallLibs.steps.yml

- name: Configure git user
run: |
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/dtslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,9 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [18.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install --legacy-peer-deps
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
- run: npm run def
- run: npm run dtslint
- name: Checkout and install dependencies steps
uses: ./.github/commonSteps/checkoutAndInstallLibs.steps.yml

- run: npm run def && npm run dtslint
15 changes: 5 additions & 10 deletions .github/workflows/expectHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,16 @@ env:
FORCE_COLOR: 1

jobs:
build:

expect-helper-test:
runs-on: ubuntu-22.04

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: npm install
run: npm i --legacy-peer-deps
- name: Checkout and install dependencies steps
uses: ./.github/commonSteps/checkoutAndInstallLibs.steps.yml

- name: run unit tests
run: ./node_modules/.bin/mocha test/helper/Expect_test.js --timeout 5000
65 changes: 34 additions & 31 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,46 @@ env:
CI: true
# Force terminal colors. @see https://www.npmjs.com/package/colors
FORCE_COLOR: 1
NODE_VERSION: 20.x
PLATFORM: ubuntu-22.04

jobs:
build:

runs-on: ubuntu-22.04
run-unit-tests:
runs-on: $PLATFORM

strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [$NODE_VERSION]
browser-restart: ['browser', 'session']

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: shivammathur/setup-php@v2
with:
php-version: 7.4
- name: npm install
run: |
npm install --legacy-peer-deps
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
- name: Install browsers and deps
run: npx playwright install && npx playwright install-deps
- name: start a server
run: "php -S 127.0.0.1:8000 -t test/data/app &"
- name: run chromium tests
run: "./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug"
- name: run chromium with restart==browser tests
run: "BROWSER_RESTART=browser ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug"
- name: run chromium with restart==session tests
run: "BROWSER_RESTART=session ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug"
- name: run firefox tests
run: "BROWSER=firefox node ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug"
- name: run webkit tests
run: "BROWSER=webkit node ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug"
- name: Checkout and install dependencies steps
uses: ./.github/commonSteps/checkoutAndInstallLibs.steps.yml

- name: Playwright common steps
uses: ./.github/commonSteps/playwright.steps.yml

- name: run chromium unit tests
run: ./node_modules/.bin/mocha test/helper/Playwright_test.js --timeout 5000

run-acceptance-tests:
runs-on: $PLATFORM

strategy:
matrix:
node-version: [ $NODE_VERSION ]
browser-restart: [ 'browser', 'session' ]
browser: [ 'chromium', 'firefox', 'webkit' ]

steps:
- name: Checkout and install dependencies steps
uses: ./.github/commonSteps/checkoutAndInstallLibs.steps.yml

- name: Playwright common steps
uses: ./.github/commonSteps/playwright.steps.yml

- name: run ${{ matrix.browser }} tests
run: BROWSER=${{ matrix.browser }} node ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug
- name: run chromium with restart==${{ browser-restart }} tests
run: BROWSER_RESTART=${{ browser-restart }} ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug

2 changes: 1 addition & 1 deletion .github/workflows/puppeteer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testcafe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/webdriver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [20.x]

steps:
- run: docker run -d --net=host --shm-size=2g selenium/standalone-chrome:3.141.0
Expand Down

0 comments on commit cae571b

Please sign in to comment.