Skip to content

Merge pull request #438 from cailloumajor/fix-timeline-palette #3224

Merge pull request #438 from cailloumajor/fix-timeline-palette

Merge pull request #438 from cailloumajor/fix-timeline-palette #3224

Workflow file for this run

name: Tests and code quality
on:
push:
branches:
- main
- "renovate/**"
pull_request:
branches:
- main
jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: same_content
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
skip_after_successful_duplicate: true
components:
name: Components tests and code coverage
runs-on: ubuntu-latest
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
env:
GHP_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Get Node version from Dockerfile
id: get-node-version
run: echo "node_version=$(grep -oP 'FROM .* node:\K[\d.]+' Dockerfile)" >> $GITHUB_OUTPUT
- uses: actions/setup-node@v3
with:
node-version: ${{ steps.get-node-version.outputs.node_version }}
cache: yarn
- run: yarn install
- name: Lint code
run: yarn lint
- name: Run components tests 🧪
uses: cypress-io/github-action@v4
with:
command: yarn test:component:ci
- name: Upload coverage to Codecov ☂️
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
fail_ci_if_error: true
- name: Upload Cypress screenshots and videos 🖥️📽️
uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-results-components
path: |
test/cypress/screenshots
test/cypress/videos
e2e:
name: End-to-end tests
runs-on: ubuntu-latest
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
env:
GHP_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Start services
run: docker compose --project-directory integration up -d
- name: Get Node version from Dockerfile
id: get-node-version
run: echo "node_version=$(grep -oP 'FROM .* node:\K[\d.]+' Dockerfile)" >> $GITHUB_OUTPUT
- uses: actions/setup-node@v3
with:
node-version: ${{ steps.get-node-version.outputs.node_version }}
cache: yarn
- name: Run end-to-end tests 🧪
uses: cypress-io/github-action@v4
env:
CENTRIFUGO_HOST: localhost
with:
command: yarn test:e2e:ci
- name: Upload Cypress screenshots and videos 🖥️📽️
uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-results-e2e
path: |
test/cypress/screenshots
test/cypress/videos
- name: Stop services
if: always()
run: docker compose --project-directory integration down -v
docker:
name: Check Docker build
runs-on: ubuntu-latest
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
steps:
- uses: actions/checkout@v3
- name: Lint Dockerfile
uses: hadolint/[email protected]
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build local image
uses: docker/build-push-action@v4
with:
cache-from: type=gha
cache-to: type=gha,mode=max
secrets: GHP_AUTH_TOKEN=${{ secrets.GITHUB_TOKEN }}