diff --git a/.github/workflows/browsers.yml b/.github/workflows/browsers.yml index 2921b0b2..40b09a94 100644 --- a/.github/workflows/browsers.yml +++ b/.github/workflows/browsers.yml @@ -2,6 +2,16 @@ name: End-to-end tests (playwright) on: push: branches: [ main, master ] + paths: + - 'src/**' + - 'test-e2e/**' + - 'package-lock.json' + - '.browserslistrc' + - 'babel.config.json' + - 'public/index.html' + - 'public/**/index.html' + - '.github/workflows/browsers.yml' + - 'playwright.config.ts' pull_request: paths: - 'src/**' diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml deleted file mode 100644 index 4ee67a0f..00000000 --- a/.github/workflows/build-and-test.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Build and test - -on: - push: - branches: [ main, master ] - -jobs: - build-and-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Install dependencies - run: npm ci --no-audit - env: - HUSKY_SKIP_INSTALL: true - - - name: Build and run all tests - run: | - npm run build - npm run bundlesize - npm run test:unit:coverage - env: - #CI: true - CI_REPO_NAME: ${{ github.event.repository.name }} - CI_REPO_OWNER: ${{ github.event.organization.login }} - CI_COMMIT_SHA: ${{ github.sha }} - GIT_COMMIT: ${{ github.sha }} - CI_BRANCH: ${{ github.head_ref }} - #BUNDLESIZE_GITHUB_TOKEN: ${{secrets.BUNDLESIZE_GITHUB_TOKEN}} - FORCE_COLOR: 2 - HUSKY_SKIP_INSTALL: true - ## - ## Disabling for now. There does not appear to be a secure way to do this - ## with protected branches. See discussion: - ## https://github.community/t/how-to-push-to-protected-branches-in-a-github-action/16101 - ## - # - name: Commit built files - # run: | - # git config --local user.email "action@github.com" - # git config --local user.name "GitHub Action" - # git commit -m "Update build files 🏗" -a || echo "No changes to commit" && exit 0 - # - name: Push changes - # uses: ad-m/github-push-action@master - # with: - # github_token: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload coverage to Codecov - run: bash <(curl -s https://codecov.io/bash) - -f ./coverage/lcov.info - -B ${{ github.head_ref }} - -C ${{ github.sha }} - -Z || echo 'Codecov upload failed' - env: - CI: true - GITLAB_CI: true # pretend we are GitLab CI, while Codecov adding support for Github Actions - CODECOV_ENV: github-action - CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} diff --git a/.github/workflows/bundlesize.yml b/.github/workflows/bundlesize.yml index 25977968..25cf415b 100644 --- a/.github/workflows/bundlesize.yml +++ b/.github/workflows/bundlesize.yml @@ -1,8 +1,17 @@ name: Bundle size checks on: + push: + branches: [ main, master ] + paths: + - '.github/workflows/bundlesize.yml' + - 'src/scripts/**' + - 'src/styles/**' + - 'package-lock.json' + - '.browserslistrc' pull_request: paths: + - '.github/workflows/bundlesize.yml' - 'src/scripts/**' - 'src/styles/**' - 'package-lock.json' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2d31ecf4..efd36880 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,14 +1,30 @@ name: Code linting on: + push: + branches: [ main, master ] + paths: + - '.github/workflows/lint.yml' + - 'src/scripts/**' + - 'src/*.ts' + - 'src/styles/**' + - 'test/**' + - 'test-e2e/**' + - 'package-lock.json' + - '.browserslistrc' + - '.eslintrc.json' + - '.editorconfig' + - '.prettierrc.json' + - '.stylelintrc.json' pull_request: paths: + - '.github/workflows/lint.yml' - 'src/scripts/**' - 'src/*.ts' - 'src/styles/**' - 'test/**' - 'test-e2e/**' - - package-lock.json + - 'package-lock.json' - '.browserslistrc' - '.eslintrc.json' - '.editorconfig' diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index fa66da64..64ea6e44 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -1,8 +1,20 @@ name: Unit tests on: + push: + branches: [ main, master ] + paths: + - '.github/workflows/unit-tests.yml' + - 'src/scripts/**' + - 'src/*.ts' + - 'test/**' + - 'package-lock.json' + - '.browserslistrc' + - 'babel.config.json' + - 'vitest.config.ts' pull_request: paths: + - '.github/workflows/unit-tests.yml' - 'src/scripts/**' - 'src/*.ts' - 'test/**'