Merge pull request #299 from element-hq/florianduros/visuallist #750
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Analysis | |
on: | |
pull_request: {} | |
push: | |
branches: [develop, main] | |
jobs: | |
lint: | |
name: "Lint" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4 | |
with: | |
cache: "yarn" | |
node-version-file: ".node-version" | |
- name: Install deps | |
run: yarn install --frozen-lockfile | |
- name: Lint | |
run: "yarn run lint" | |
- name: Check formatting | |
run: "yarn run prettier:check" | |
test: | |
name: "Unit test" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4 | |
with: | |
cache: "yarn" | |
node-version-file: ".node-version" | |
- name: Install deps | |
run: yarn install --frozen-lockfile | |
- name: Test | |
run: "yarn run test --coverage" | |
- name: Upload Artifact | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 | |
with: | |
name: coverage | |
path: | | |
coverage | |
!coverage/lcov-report | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} | |
e2e: | |
name: "Test end-to-end" | |
# This must be kept in sync with the version of ubuntu used in the Docker | |
# image, in playwright/Dockerfile | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4 | |
with: | |
cache: "yarn" | |
node-version-file: ".node-version" | |
- name: Install deps | |
run: yarn install --frozen-lockfile | |
- name: Build Storybook | |
run: yarn build-storybook | |
- name: Get Playwright version | |
run: echo "PLAYWRIGHT_VERSION=$(yarn list --pattern @playwright/test --depth=0 --json --non-interactive --no-progress | jq -r '.data.trees[].name')" >> $GITHUB_ENV | |
- name: Cache Playwright binaries | |
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 | |
id: playwright-cache | |
with: | |
path: | | |
~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} | |
- name: Install Playwright binaries | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
run: yarn playwright install --with-deps | |
- name: Run Playwright tests | |
# We use this action to get a virtual frame buffer for the browsers | |
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1 | |
with: | |
run: yarn playwright test -j 100% | |
- name: Upload Playwright report | |
if: always() | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 | |
with: | |
name: html-report--attempt-${{ github.run_attempt }} | |
path: playwright-report | |
retention-days: 14 |