170 lines
5.4 KiB
YAML
170 lines
5.4 KiB
YAML
name: E2E matrix
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 0 * * *"
|
|
workflow_dispatch:
|
|
inputs:
|
|
debug_enabled:
|
|
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
|
|
required: false
|
|
default: false
|
|
|
|
jobs:
|
|
e2e:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- macos-latest
|
|
# - windows-latest
|
|
include:
|
|
- os: ubuntu-latest
|
|
os-name: ubuntu
|
|
- os: macos-latest
|
|
os-name: osx
|
|
# - os: windows-latest
|
|
# os-name: windows
|
|
node_version:
|
|
- '14'
|
|
- '15'
|
|
- '16'
|
|
package_manager:
|
|
- npm
|
|
- yarn
|
|
- pnpm
|
|
packages:
|
|
- e2e-angular-core,e2e-angular-extensions
|
|
- e2e-cli,e2e-nx-plugin,e2e-jest,e2e-linter
|
|
- e2e-cypress
|
|
- e2e-gatsby,e2e-react
|
|
- e2e-next
|
|
- e2e-node
|
|
- e2e-web
|
|
- e2e-storybook
|
|
- e2e-workspace
|
|
- e2e-react-native,e2e-detox
|
|
exclude:
|
|
- os: ubuntu-latest
|
|
node_version: '14'
|
|
package_manager: pnpm
|
|
- os: ubuntu-latest
|
|
node_version: '15'
|
|
package_manager: npm
|
|
- os: ubuntu-latest
|
|
node_version: '15'
|
|
package_manager: yarn
|
|
- os: ubuntu-latest
|
|
node_version: '16'
|
|
package_manager: npm
|
|
- os: ubuntu-latest
|
|
node_version: '16'
|
|
package_manager: yarn
|
|
- os: macos-latest
|
|
node_version: '14'
|
|
- os: macos-latest
|
|
node_version: '15'
|
|
- os: macos-latest
|
|
package_manager: yarn
|
|
- os: macos-latest
|
|
package_manager: pnpm
|
|
- os: macos-latest
|
|
packages: e2e-workspace
|
|
# - os: windows-latest
|
|
# package_manager: npm
|
|
# - os: windows-latest
|
|
# package_manager: yarn
|
|
fail-fast: false
|
|
|
|
name: ${{ matrix.os-name }}/n v${{ matrix.node_version }}/${{ matrix.package_manager }} - ${{ matrix.packages }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Use Node.js ${{ matrix.node_version }}
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: ${{ matrix.node_version }}
|
|
|
|
- name: Yarn cache directory path
|
|
id: yarn-cache-dir-path
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
- name: Cache yarn
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
key: ${{ matrix.os }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('yarn.lock') }}
|
|
restore-keys: |
|
|
${{ matrix.os }}-node-${{ matrix.node-version }}-yarn-
|
|
|
|
- name: Install packages
|
|
run: yarn install --prefer-offline --non-interactive
|
|
|
|
- name: Cleanup
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
run: |
|
|
# Workaround to provide additional free space for testing.
|
|
# https://github.com/actions/virtual-environments/issues/2840
|
|
sudo rm -rf /usr/share/dotnet
|
|
sudo rm -rf /opt/ghc
|
|
sudo rm -rf "/usr/local/share/boost"
|
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
|
sudo apt-get install lsof
|
|
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
|
|
|
|
- name: Install PNPM
|
|
if: ${{ matrix.package_manager == 'pnpm' }}
|
|
uses: pnpm/action-setup@v2.0.1
|
|
with:
|
|
version: 6.9.1
|
|
|
|
- name: Install applesimutils, reset ios simulators
|
|
if: ${{ matrix.os == 'macos-latest' }}
|
|
run: |
|
|
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
|
|
brew install applesimutils
|
|
xcrun simctl shutdown all && xcrun simctl erase all
|
|
|
|
- name: Run e2e tests
|
|
run: yarn nx run-many --target=e2e --projects="${{ join(matrix.packages) }}"
|
|
env:
|
|
GIT_AUTHOR_NAME: test@test.com
|
|
GIT_AUTHOR_EMAIL: Test
|
|
GIT_COMMITTER_EMAIL: test@test.com
|
|
GIT_COMMITTER_NAME: Test
|
|
NX_E2E_CI_CACHE_KEY: e2e-gha-${{ matrix.os }}-${{ matrix.node_version }}-${{ matrix.package_manager }}
|
|
NX_E2E_RUN_CYPRESS: ${{ 'true' }}
|
|
NODE_OPTIONS: --max_old_space_size=8192
|
|
SELECTED_PM: ${{ matrix.package_manager }}
|
|
npm_config_registry: http://localhost:4872
|
|
YARN_REGISTRY: http://localhost:4872
|
|
VERBOSE_OUTPUT: ${{ 'true' }}
|
|
|
|
- name: Setup tmate session
|
|
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled && failure() }}
|
|
uses: mxschmitt/action-tmate@v3
|
|
with:
|
|
sudo: ${{ matrix.os != 'windows-latest' }} # disable sudo for windows debugging
|
|
|
|
report:
|
|
if: ${{ always() && github.repository_owner == 'nrwl' && github.event_name != 'workflow_dispatch' }}
|
|
needs: e2e
|
|
runs-on: ubuntu-latest
|
|
name: Report status
|
|
steps:
|
|
- name: Send notification
|
|
uses: ravsamhq/notify-slack-action@v1
|
|
with:
|
|
status: ${{ needs.e2e.result }}
|
|
message_format: '{emoji} *{workflow}* {status_message} (last commit <{commit_url}|{commit_sha}>)'
|
|
notification_title: '{workflow} has {status_message}'
|
|
footer: '<{run_url}|View Run>'
|
|
mention_users: 'U01UELKLYF2,U9NPA6C90'
|
|
mention_users_when: 'failure,warnings'
|
|
env:
|
|
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
|