Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making jobs uniform across #1054

Merged
merged 5 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/manual_public_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@ jobs:
needs: release-public-version
uses: ./.github/workflows/tag.yaml

e2e-node16:
e2e-node20:
if: github.ref == 'refs/heads/main'
uses: ./.github/workflows/~reusable_e2e.yaml
uses: ./.github/workflows/~reusable_e2e_all_OS.yaml
needs: release-tag
with:
BRANCH: main
NPM_IGNORE_PREFIX: ${{ vars.NPM_IGNORE_PREFIX }}
PACKAGE_VERSION: latest
FLEX_UI_VERSION: latest
SEND_NOTIFICATION: true
SLACK_TITLE: 'Public Manual Release E2E for Version ${{ github.event.inputs.version }}'
SLACK_MESSAGE: 'Release E2E'
secrets:
CONSOLE_EMAIL: ${{ secrets.CONSOLE_EMAIL }}
CONSOLE_PASSWORD: ${{ secrets.CONSOLE_PASSWORD }}
Expand All @@ -54,3 +57,4 @@ jobs:
CONSOLE_EMAIL_darwin: ${{ secrets.CONSOLE_EMAIL_darwin }}
TWILIO_ACCOUNT_SID_darwin: ${{ secrets.TWILIO_ACCOUNT_SID_darwin }}
TWILIO_AUTH_TOKEN_darwin: ${{ secrets.TWILIO_AUTH_TOKEN_darwin }}
SLACK_WEB_HOOK: ${{ secrets.SLACK_WEB_HOOK }}
8 changes: 6 additions & 2 deletions .github/workflows/manual_public_release_v6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@ jobs:
needs: release-public-version
uses: ./.github/workflows/tag.yaml

e2e-node16:
e2e-node20:
if: github.ref == 'refs/heads/main'
uses: ./.github/workflows/~reusable_e2e.yaml
uses: ./.github/workflows/~reusable_e2e_all_OS.yaml
needs: release-tag
with:
BRANCH: FLEXY-5323-6.4.2
NPM_IGNORE_PREFIX: ${{ vars.NPM_IGNORE_PREFIX }}
PACKAGE_VERSION: 6.4.2
FLEX_UI_VERSION: latest
SEND_NOTIFICATION: true
SLACK_TITLE: 'Public Manual Release E2E for Version ${{ github.event.inputs.version }}'
SLACK_MESSAGE: 'Release E2E'
secrets:
CONSOLE_EMAIL: ${{ secrets.CONSOLE_EMAIL }}
CONSOLE_PASSWORD: ${{ secrets.CONSOLE_PASSWORD }}
Expand All @@ -54,3 +57,4 @@ jobs:
CONSOLE_EMAIL_darwin: ${{ secrets.CONSOLE_EMAIL_darwin }}
TWILIO_ACCOUNT_SID_darwin: ${{ secrets.TWILIO_ACCOUNT_SID_darwin }}
TWILIO_AUTH_TOKEN_darwin: ${{ secrets.TWILIO_AUTH_TOKEN_darwin }}
SLACK_WEB_HOOK: ${{ secrets.SLACK_WEB_HOOK }}
4 changes: 3 additions & 1 deletion .github/workflows/pr_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ jobs:

e2e-test:
needs: [ get-version, release-alpha-version ]
uses: ./.github/workflows/~reusable_e2e.yaml
uses: ./.github/workflows/~reusable_e2e_all_OS.yaml
if: ${{ always() && ((github.event.label.name == vars.E2E_LABEL) || (github.event.label.name == vars.PUBLISH_AND_E2E_LABEL)) }}
with:
BRANCH: ${{ needs.get-version.outputs.branch }}
NPM_IGNORE_PREFIX: ${{ vars.NPM_IGNORE_PREFIX }}
PACKAGE_VERSION: ${{ github.event.label.name == vars.E2E_LABEL && 'latest' || needs.get-version.outputs.version }}
FLEX_UI_VERSION: latest
SEND_NOTIFICATION: false
secrets:
CONSOLE_EMAIL: ${{ secrets.CONSOLE_EMAIL }}
CONSOLE_PASSWORD: ${{ secrets.CONSOLE_PASSWORD }}
Expand All @@ -63,6 +64,7 @@ jobs:
CONSOLE_EMAIL_darwin: ${{ secrets.CONSOLE_EMAIL_darwin }}
TWILIO_ACCOUNT_SID_darwin: ${{ secrets.TWILIO_ACCOUNT_SID_darwin }}
TWILIO_AUTH_TOKEN_darwin: ${{ secrets.TWILIO_AUTH_TOKEN_darwin }}
SLACK_WEB_HOOK: ${{ secrets.SLACK_WEB_HOOK }}

remove-label-on-failure:
needs: e2e-test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ on:
description: 'A npm-ignore-prefix passed from the caller workflow.'
required: true
type: string
SEND_NOTIFICATION:
description: 'A flag passed from the caller workflow, it decides whether to send slack notification or not.'
required: true
type: boolean

secrets:
CONSOLE_EMAIL:
Expand Down Expand Up @@ -50,6 +54,9 @@ on:
TWILIO_AUTH_TOKEN_darwin:
description: 'An account-token passed from the caller workflow, it will be used for authentication of APIs in mac environment.'
required: true
SLACK_WEB_HOOK:
description: 'A slack-web-hook passed from the caller workflow, it will be used for sending notifications.'
required: true
env:
BRANCH: ${{ inputs.BRANCH }}
NPM_IGNORE_PREFIX: ${{ inputs.NPM_IGNORE_PREFIX }}
Expand All @@ -69,96 +76,30 @@ env:
NODE_OPTIONS: --max-old-space-size=8192

jobs:
node20-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install project dependencies
run: npm ci
- name: Build packages
run: npm run build
- name: Run e2e tests - JS
run: |
cd packages/flex-plugin-e2e-tests
npm run start
env:
TS: 0
- name: Run e2e tests - TS
env:
TS: 1
run: |
cd packages/flex-plugin-e2e-tests
npm run start
- name: Upload Screenshots
uses: actions/upload-artifact@v3
if: always()
with:
name: Ubuntu-screenshots
path: packages/flex-plugin-e2e-tests/screenshots

node20-macos:
needs: node20-ubuntu
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install project dependencies
run: npm ci
- name: Build packages
run: npm run build
- name: Run e2e tests - JS
run: |
cd packages/flex-plugin-e2e-tests
npm run start
env:
TS: 0
- name: Run e2e tests - TS
env:
TS: 1
run: |
cd packages/flex-plugin-e2e-tests
npm run start
- name: Upload Screenshots
uses: actions/upload-artifact@v3
if: always()
with:
name: Macos-screenshots
path: packages/flex-plugin-e2e-tests/screenshots
node20:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
uses: ./.github/workflows/~reusable_e2e_by_OS.yaml
with:
OS: ${{ matrix.os }}
BRANCH: main
NPM_IGNORE_PREFIX: ${{ vars.NPM_IGNORE_PREFIX }}
PACKAGE_VERSION: latest
FLEX_UI_VERSION: latest
SEND_NOTIFICATION: ${{ inputs.SEND_NOTIFICATION }}
secrets:
CONSOLE_EMAIL: ${{ secrets.CONSOLE_EMAIL }}
CONSOLE_PASSWORD: ${{ secrets.CONSOLE_PASSWORD }}
CONSOLE_EMAIL_linux: ${{ secrets.CONSOLE_EMAIL_linux }}
TWILIO_ACCOUNT_SID_linux: ${{ secrets.TWILIO_ACCOUNT_SID_linux }}
TWILIO_AUTH_TOKEN_linux: ${{ secrets.TWILIO_AUTH_TOKEN_linux }}
CONSOLE_EMAIL_win32: ${{ secrets.CONSOLE_EMAIL_win32 }}
TWILIO_ACCOUNT_SID_win32: ${{ secrets.TWILIO_ACCOUNT_SID_win32 }}
TWILIO_AUTH_TOKEN_win32: ${{ secrets.TWILIO_AUTH_TOKEN_win32 }}
CONSOLE_EMAIL_darwin: ${{ secrets.CONSOLE_EMAIL_darwin }}
TWILIO_ACCOUNT_SID_darwin: ${{ secrets.TWILIO_ACCOUNT_SID_darwin }}
TWILIO_AUTH_TOKEN_darwin: ${{ secrets.TWILIO_AUTH_TOKEN_darwin }}
SLACK_WEB_HOOK: ${{ secrets.SLACK_WEB_HOOK }}

node20-windows:
needs: [ node20-ubuntu, node20-macos ]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install project dependencies
run: npm ci
- name: Build packages
run: npm run build
- name: Run e2e tests - JS
run: |
cd packages/flex-plugin-e2e-tests
npm run start
env:
TS: 0
- name: Kill node for Windows os
run: taskkill /f /im node.exe
- name: Run e2e tests - TS
env:
TS: 1
run: |
cd packages/flex-plugin-e2e-tests
npm run start
- name: Upload Screenshots
uses: actions/upload-artifact@v3
if: always()
with:
name: Windows-screenshots
path: packages/flex-plugin-e2e-tests/screenshots
56 changes: 25 additions & 31 deletions .github/workflows/~reusable_e2e_by_OS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ on:
description: 'Operating system passed from the caller workflow, it decides the OS on which the tests will run.'
required: true
type: string
SEND_NOTIFICATION:
description: 'A flag passed from the caller workflow, it decides whether to send slack notification or not.'
required: true
type: boolean
SLACK_TITLE:
description: 'A title passed from the caller workflow, it will be used in slack notification.'
required: false
type: string
default: 'Flex Plugins CLI - E2E'
SLACK_MESSAGE:
description: 'A message passed from the caller workflow, it will be used in slack notification.'
required: false
type: string
default: 'E2E tests failed for'

secrets:
CONSOLE_EMAIL:
Expand Down Expand Up @@ -84,32 +98,17 @@ jobs:
with:
node-version: '20'
- name: Install project dependencies
uses: nick-fields/retry@v3
with:
timeout_minutes: 15
max_attempts: 2
retry_on: timeout
command: |
npm ci
run: |
npm ci
- name: Build packages
uses: nick-fields/retry@v3
with:
timeout_minutes: 2
max_attempts: 2
retry_on: timeout
command: |
npm run build
run: |
npm run build
- name: Run e2e tests - JS
env:
TS: 0
uses: nick-fields/retry@v3
with:
timeout_minutes: 90
max_attempts: 2
retry_on: timeout
command: |
cd packages/flex-plugin-e2e-tests
npm run start
run: |
cd packages/flex-plugin-e2e-tests
npm run start
- name: Kill node for Windows os
if: ${{ inputs.OS == 'windows-latest' }}
run: |
Expand All @@ -118,12 +117,7 @@ jobs:
- name: Run e2e tests - TS
env:
TS: 1
uses: nick-fields/retry@v3
with:
timeout_minutes: 90
max_attempts: 2
retry_on: timeout
command: |
run: |
cd packages/flex-plugin-e2e-tests
npm run start
- name: Upload Screenshots
Expand All @@ -136,7 +130,7 @@ jobs:
notify-failure:
runs-on: ubuntu-latest
needs: node20
if: always()
if: ${{ always() && inputs.SEND_NOTIFICATION }}
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
Expand All @@ -146,6 +140,6 @@ jobs:
SLACK_COLOR: failure
SLACK_USERNAME: Github Actions
SLACK_ICON_EMOJI: ':ship:'
SLACK_TITLE: 'Flex Plugins CLI - E2E Nightly - ${{ inputs.OS }}'
SLACK_MESSAGE: '${{ github.repository }}/${{ github.ref }} - nightly E2E tests failed for ${{ inputs.OS }}.'
SLACK_TITLE: '${{ inputs.SLACK_TITLE }} - ${{ inputs.OS }}'
SLACK_MESSAGE: '${{ github.repository }}/${{ github.ref }} - ${{ inputs.SLACK_MESSAGE }} ${{ inputs.OS }}.'
MSG_MINIMAL: actions url
Loading