Skip to content

Commit

Permalink
chore: switch from circle ci to github actions (#3783)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson authored Oct 23, 2023
1 parent 300b4ea commit f3252fb
Show file tree
Hide file tree
Showing 8 changed files with 208 additions and 438 deletions.
435 changes: 0 additions & 435 deletions .circleci/config.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
BEST_FRONTEND_HOSTNAME: ${{secrets.BEST_FRONTEND_HOSTNAME}}
BEST_HUB_CLIENT_TOKEN: ${{secrets.BEST_HUB_CLIENT_TOKEN}}
BEST_HUB_HOSTNAME: ${{secrets.BEST_HUB_HOSTNAME}}
PUPPETEER_SKIP_DOWNLOAD: "true" # only needed for @best/runner-local, unused here

jobs:
run-best-performance-tests:
Expand All @@ -27,8 +28,7 @@ jobs:
cache: 'yarn'

- name: Install dependencies
# Puppeteer Chromium download is only needed for @best/runner-local, which is unused here
run: PUPPETEER_SKIP_DOWNLOAD=true yarn install --frozen-lockfile
run: yarn install --frozen-lockfile

- name: Build benchmarks
run: yarn build:performance
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Run WebDriverIO integration tests

on:
push:
branches:
- master
- release
- 'spring*'
- 'summer*'
- 'winter*'
pull_request:
branches:
- master
- release
- 'spring*'
- 'summer*'
- 'winter*'

env:
SAUCE_USERNAME: ${{secrets.SAUCE_USERNAME}}
SAUCE_ACCESS_KEY: ${{secrets.SAUCE_ACCESS_KEY}}
SAUCE_TUNNEL_ID: github-action-tunnel-karma-${{github.run_id}}
PUPPETEER_SKIP_DOWNLOAD: "true" # only needed for @best/runner-local, unused here

jobs:
run-integration-tests:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./packages/@lwc/integration-tests
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18.18.0"
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile
working-directory: ./

- uses: saucelabs/sauce-connect-action@v2
with:
username: ${{ secrets.SAUCE_USERNAME }}
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
tunnelName: ${{ env.SAUCE_TUNNEL_ID }}

- run: yarn sauce:prod --browsers chrome
- run: yarn sauce:dev --browsers chrome
68 changes: 68 additions & 0 deletions .github/workflows/karma.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Run Karma integration tests

on:
push:
branches:
- master
- release
- 'spring*'
- 'summer*'
- 'winter*'
pull_request:
branches:
- master
- release
- 'spring*'
- 'summer*'
- 'winter*'

env:
SAUCE_USERNAME: ${{secrets.SAUCE_USERNAME}}
SAUCE_ACCESS_KEY: ${{secrets.SAUCE_ACCESS_KEY}}
SAUCE_TUNNEL_ID: github-action-tunnel-integration-${{github.run_id}}
PUPPETEER_SKIP_DOWNLOAD: "true" # only needed for @best/runner-local, unused here
COVERAGE: "1"

jobs:
run-karma-tests:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./packages/@lwc/integration-karma
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18.18.0"
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile
working-directory: ./

- uses: saucelabs/sauce-connect-action@v2
with:
username: ${{ secrets.SAUCE_USERNAME }}
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
tunnelName: ${{ env.SAUCE_TUNNEL_ID }}

- run: yarn sauce:ci
- run: DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: LEGACY_BROWSERS=1 yarn sauce:ci
- run: FORCE_NATIVE_SHADOW_MODE_FOR_TEST=1 yarn sauce:ci
- run: ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 yarn sauce:ci
- run: ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: API_VERSION=58 yarn sauce:ci
- run: API_VERSION=58 DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: API_VERSION=59 yarn sauce:ci
- run: API_VERSION=59 DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: ENABLE_ARIA_REFLECTION_GLOBAL_POLYFILL=1 yarn sauce:ci
- run: ENABLE_ARIA_REFLECTION_GLOBAL_POLYFILL=1 DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: DISABLE_SYNTHETIC_SHADOW_SUPPORT_IN_COMPILER=1 DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: NODE_ENV_FOR_TEST=production yarn sauce:ci
- run: NODE_ENV_FOR_TEST=production DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: yarn hydration:sauce:ci
- run: yarn coverage
55 changes: 55 additions & 0 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Run unit tests

on:
push:
branches:
- master
- release
- 'spring*'
- 'summer*'
- 'winter*'
pull_request:
branches:
- master
- release
- 'spring*'
- 'summer*'
- 'winter*'

env:
PUPPETEER_SKIP_DOWNLOAD: "true" # only needed for @best/runner-local, unused here

jobs:
run-unit-tests:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18.18.0"
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Check missing file headers
run: node ./scripts/tasks/check-license-headers.js
- name: Check package.json integrity
run: node ./scripts/tasks/check-and-rewrite-package-json.js --test
- name: Verify @lwc/shared is tree-shakable
run: node ./scripts/tasks/verify-treeshakable.js ./packages/@lwc/shared/dist/index.js
- name: Verify that dependencies are declared
run: node ./scripts/tasks/check-imports-are-declared-dependencies.js
- name: Check formatting
run: yarn prettier --check '{packages,scripts}/**/*.{js,ts,json,md}'
- name: Run linter
run: yarn lint
- name: Check the size of the LWC bundle
run: yarn bundlesize
- name: Run Jest tests
run: yarn test:ci
- name: Run benchmark smoke tests
run: BENCHMARK_SMOKE_TEST=1 yarn test:performance
2 changes: 2 additions & 0 deletions packages/@lwc/integration-karma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"hydration:start": "karma start ./scripts/karma-configs/hydration/local.js",
"hydration:test": "karma start ./scripts/karma-configs/hydration/local.js --single-run --browsers ChromeHeadless",
"hydration:sauce": "karma start ./scripts/karma-configs/hydration/sauce.js --single-run",
"hydration:sauce:ci": "../../../scripts/ci/retry.sh karma start ./scripts/karma-configs/hydration/sauce.js --single-run",
"sauce": "karma start ./scripts/karma-configs/test/sauce.js --single-run",
"sauce:ci": "../../../scripts/ci/retry.sh karma start ./scripts/karma-configs/test/sauce.js --single-run",
"coverage": "node ./scripts/merge-coverage.js"
},
"//": {
Expand Down
4 changes: 3 additions & 1 deletion packages/@lwc/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"local:prod": "yarn build:prod && MODE=prod wdio ./scripts/wdio.local.conf.js",
"sauce": "yarn sauce:prod",
"sauce:dev": "MODE=dev yarn build:dev && MODE=dev wdio ./scripts/wdio.sauce.conf.js",
"sauce:prod": "MODE=prod yarn build:prod && MODE=prod wdio ./scripts/wdio.sauce.conf.js"
"sauce:prod": "MODE=prod yarn build:prod && MODE=prod wdio ./scripts/wdio.sauce.conf.js",
"sauce:dev:ci": "MODE=dev yarn build:dev && MODE=dev ../../../scripts/ci/retry.sh wdio ./scripts/wdio.sauce.conf.js",
"sauce:prod:ci": "MODE=prod yarn build:prod && MODE=prod ../../../scripts/ci/retry.sh wdio ./scripts/wdio.sauce.conf.js"
},
"devDependencies": {
"@lwc/rollup-plugin": "4.0.0",
Expand Down
26 changes: 26 additions & 0 deletions scripts/ci/retry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
#
# Copyright (c) 2023, salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: MIT
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
#
# Retry a script multiple times before failing. Used for CI.
#

set -e

export PATH="${PATH}:./node_modules/.bin"

MAX_RETRY=3
n=0
until [ $n -ge $MAX_RETRY ]
do
echo "Try $[$n+1]/$MAX_RETRY..."
"$@" && break
n=$[$n+1]
done
if [ $n -ge $MAX_RETRY ]; then
echo "Failed: ${@}" >&2
exit 1
fi

0 comments on commit f3252fb

Please sign in to comment.