Skip to content

chore(data-widget): move three state checkbox style to atlas core #2715

chore(data-widget): move three state checkbox style to atlas core

chore(data-widget): move three state checkbox style to atlas core #2715

Workflow file for this run

name: Run build jobs
# This workflow is main place for build jobs.
# If you need add job that will run as part of github check
# you need add it in this file.
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
since_flag: ${{ github.event_name == 'pull_request' && format('--filter "...[origin/{0}]"', github.base_ref) || '' }}
jobs:
check-sha:
name: Check SHA in GH Actions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: zgosalvez/github-actions-ensure-sha-pinned-actions@99589360fda82ecfac331cc6bfc9d7d74487359c # v2.1.6
check:
name: Run code quality check
runs-on: ubuntu-latest
needs: [check-sha]
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
- name: Setup node
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Get sha of main
run: echo "main_sha=$(git rev-parse origin/main)" >> $GITHUB_ENV
- name: Restore Turbo Cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
path: node_modules/.cache/turbo
# NOTE: We create new cache record for every new commit on main
# but fallback to latest entry
key: turbo-cache-${{ runner.os }}-lint-test-${{ env.main_sha }}
restore-keys: |
turbo-cache-${{ runner.os }}-lint-test
- name: Install dependencies
run: pnpm install
- name: Lint code
run: pnpm run lint ${{ env.since_flag }}
- name: Run unit tests
run: pnpm run test ${{ env.since_flag }}
build:
name: Run ${{ matrix.target }} task on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: [check-sha, check]
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
target: [build, release]
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
- name: Setup node
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Get sha of main
run: echo "main_sha=$(git rev-parse origin/main)" >> ${{ runner.os == 'Windows' && '$env:GITHUB_ENV' || '$GITHUB_ENV' }}
- name: Restore Turbo Cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
path: node_modules/.cache/turbo
# NOTE: build & release tasks should have their own cache
# this is why we include matrix.target param in key
# NOTE: We create new cache record for every new commit on main
# but fallback to latest entry
key: turbo-cache-${{ runner.os }}-${{ matrix.target }}-${{ env.main_sha }}
restore-keys: |
turbo-cache-${{ runner.os }}-${{ matrix.target }}
- if: runner.os == 'Windows'
name: Set concurrency on Windows
run: echo "task_concurrency=3" >> $env:GITHUB_ENV
- if: runner.os == 'Linux'
name: Set concurrency on Linux
run: echo "task_concurrency=5" >> $GITHUB_ENV
- name: Install dependencies
run: pnpm install
- name: Run ${{ matrix.target }} task
run: pnpm run ${{ matrix.target }} --concurrency=${{ env.task_concurrency }} ${{ env.since_flag }}
env:
# Limit memory to avoid out of memory issues
NODE_OPTIONS: "--max-old-space-size=5120 --max_old_space_size=5120"
e2e:
name: Run automated end-to-end tests
needs: [check-sha]
# Run job only if it's push to main or PR from web-widgets, don't run for fork PRs
if: >-
${{ github.event_name == 'push' ||
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == 'mendix/web-widgets' }}
runs-on: ubuntu-latest
permissions:
packages: read
contents: read
strategy:
# when one test fails, DO NOT cancel the other
fail-fast: false
matrix:
# run 3 copies of the current job in parallel
index: [0, 1, 2]
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
- name: Setup node
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Get sha of main
run: echo "main_sha=$(git rev-parse origin/main)" >> ${{ runner.os == 'Windows' && '$env:GITHUB_ENV' || '$GITHUB_ENV' }}
- name: Restore Turbo Cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
path: node_modules/.cache/turbo
key: turbo-cache-${{ runner.os }}-e2e-chunk-${{ matrix.index }}-${{ env.main_sha }}
restore-keys: |
turbo-cache-${{ runner.os }}-e2e-chunk-${{ matrix.index }}
- name: Install dependencies
run: pnpm install
- name: "Executing E2E tests"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >-
node
./automation/run-e2e/bin/run-e2e-in-chunks.mjs
--chunks 3
--index ${{ matrix.index }}
--event-name ${{ github.event_name }}
- name: "Fixing files permissions"
if: failure()
run: |
sudo find ${{ github.workspace }}/packages/* -type d -exec chmod 755 {} \;
sudo find ${{ github.workspace }}/packages/* -type f -exec chmod 644 {} \;
- name: "Generating test report"
working-directory: ./automation/run-e2e
if: failure()
run: |
report_count=$(find ../../packages -type f -path "*/cypress/results/*" -name "*.json" | wc -l)
if [ $report_count -gt 0 ];
then
pnpm run report:merge
pnpm run report:generate
fi
- name: "Archive test screenshot diff results and test report"
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
if: failure()
with:
name: test-screenshot-results
path: |
${{ github.workspace }}/packages/**/tests/e2e/screenshot-results/diff/**/*.png
${{ github.workspace }}/packages/**/tests/e2e/screenshot-results/TESTFAIL_*.png
${{ github.workspace }}/packages/**/cypress-visual-screenshots/diff/*.png
${{ github.workspace }}/packages/**/cypress-visual-screenshots/comparison/*.png
${{ github.workspace }}/packages/**/cypress/videos/*.mp4
${{ github.workspace }}/automation/run-e2e/mochawesome-report/
if-no-files-found: error