chore(ci): update CI to run more less often and more efficient
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
# This workflow runs browser-based tests using Cypress
|
||||
# Triggers:
|
||||
# - Push/PR with web or browser test changes
|
||||
# Skips:
|
||||
# - Documentation-only changes in web/
|
||||
# - Configuration-only changes
|
||||
|
||||
name: Browser Tests
|
||||
|
||||
on:
|
||||
@@ -30,11 +37,27 @@ jobs:
|
||||
uses: actions/checkout@v5
|
||||
if: github.event_name == 'push'
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files-yaml
|
||||
uses: tj-actions/changed-files@v46
|
||||
with:
|
||||
files_yaml: |
|
||||
testable:
|
||||
- 'web/**/*.{tsx,ts,jsx,js,css,scss}'
|
||||
- 'test/automated/browser/**'
|
||||
- '**/*.go'
|
||||
- 'go.mod'
|
||||
- 'go.sum'
|
||||
docs:
|
||||
- '**/*.md'
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
if: steps.changed-files-yaml.outputs.testable_any_changed == 'true'
|
||||
with:
|
||||
node-version: '22.18.0'
|
||||
|
||||
- name: Cache node modules
|
||||
if: steps.changed-files-yaml.outputs.testable_any_changed == 'true'
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: cache-node-modules-browser-tests
|
||||
@@ -47,14 +70,17 @@ jobs:
|
||||
${{ runner.os }}-
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
if: steps.changed-files-yaml.outputs.testable_any_changed == 'true'
|
||||
with:
|
||||
go-version: '1.24'
|
||||
cache: true
|
||||
|
||||
- name: Install Google Chrome
|
||||
if: steps.changed-files-yaml.outputs.testable_any_changed == 'true'
|
||||
run: sudo apt-get update && sudo apt-get install google-chrome-stable
|
||||
|
||||
- name: Run Browser tests
|
||||
if: steps.changed-files-yaml.outputs.testable_any_changed == 'true'
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
timeout_minutes: 20
|
||||
|
||||
Reference in New Issue
Block a user