chore(ci): update CI to run more less often and more efficient
This commit is contained in:
@@ -1,3 +1,13 @@
|
|||||||
|
# This workflow runs automated API integration tests using Earthly
|
||||||
|
# Triggers:
|
||||||
|
# - Push/PR with Go file changes
|
||||||
|
# Skips:
|
||||||
|
# - Web-only changes
|
||||||
|
# Uses:
|
||||||
|
# - Earthly for reproducible builds
|
||||||
|
# - QEMU for cross-platform testing
|
||||||
|
# - Retries up to 3 times for flaky tests
|
||||||
|
|
||||||
name: Automated API tests
|
name: Automated API tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
|||||||
@@ -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
|
name: Browser Tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -30,11 +37,27 @@ jobs:
|
|||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
if: github.event_name == 'push'
|
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
|
- uses: actions/setup-node@v4
|
||||||
|
if: steps.changed-files-yaml.outputs.testable_any_changed == 'true'
|
||||||
with:
|
with:
|
||||||
node-version: '22.18.0'
|
node-version: '22.18.0'
|
||||||
|
|
||||||
- name: Cache node modules
|
- name: Cache node modules
|
||||||
|
if: steps.changed-files-yaml.outputs.testable_any_changed == 'true'
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
env:
|
env:
|
||||||
cache-name: cache-node-modules-browser-tests
|
cache-name: cache-node-modules-browser-tests
|
||||||
@@ -47,14 +70,17 @@ jobs:
|
|||||||
${{ runner.os }}-
|
${{ runner.os }}-
|
||||||
|
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
|
if: steps.changed-files-yaml.outputs.testable_any_changed == 'true'
|
||||||
with:
|
with:
|
||||||
go-version: '1.24'
|
go-version: '1.24'
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- name: Install Google Chrome
|
- 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
|
run: sudo apt-get update && sudo apt-get install google-chrome-stable
|
||||||
|
|
||||||
- name: Run Browser tests
|
- name: Run Browser tests
|
||||||
|
if: steps.changed-files-yaml.outputs.testable_any_changed == 'true'
|
||||||
uses: nick-fields/retry@v3
|
uses: nick-fields/retry@v3
|
||||||
with:
|
with:
|
||||||
timeout_minutes: 20
|
timeout_minutes: 20
|
||||||
|
|||||||
@@ -1,3 +1,15 @@
|
|||||||
|
# This workflow builds and deploys Storybook component documentation
|
||||||
|
# Triggers:
|
||||||
|
# - Push to develop branch with changes to:
|
||||||
|
# - web/stories/** (story files)
|
||||||
|
# - web/components/** (component source)
|
||||||
|
# - web/.storybook/** (Storybook config)
|
||||||
|
# - web/i18n/** (translations)
|
||||||
|
# Output:
|
||||||
|
# - Generates updated story files
|
||||||
|
# - Builds Storybook to docs/components
|
||||||
|
# - Dispatches event to owncast.github.io for deployment
|
||||||
|
|
||||||
name: Build and Deploy Components+Style Guide
|
name: Build and Deploy Components+Style Guide
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -16,6 +28,13 @@ jobs:
|
|||||||
if: github.repository == 'owncast/owncast'
|
if: github.repository == 'owncast/owncast'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- id: skip_check
|
||||||
|
uses: fkirc/skip-duplicate-actions@v5
|
||||||
|
with:
|
||||||
|
concurrent_skipping: 'same_content_newer'
|
||||||
|
cancel_others: 'true'
|
||||||
|
skip_after_successful_duplicate: 'true'
|
||||||
|
|
||||||
- name: Check out pull request code
|
- name: Check out pull request code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
# .github/workflows/chromatic.yml
|
# .github/workflows/chromatic.yml
|
||||||
|
|
||||||
# Workflow name
|
# This workflow publishes Storybook to Chromatic for visual regression testing
|
||||||
|
# Triggers:
|
||||||
|
# - Push/PR with changes to web/ directory
|
||||||
|
# Skips:
|
||||||
|
# - Static files
|
||||||
|
# - next.config.js changes
|
||||||
|
# - Renovate bot PRs
|
||||||
|
# Features:
|
||||||
|
# - Uses onlyChanged for efficient testing
|
||||||
|
# - Publishes visual diffs for review
|
||||||
|
|
||||||
name: 'Chromatic'
|
name: 'Chromatic'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
# See https://docs.earthly.dev/ci-integration/vendor-specific-guides/gh-actions-integration
|
# See https://docs.earthly.dev/ci-integration/vendor-specific-guides/gh-actions-integration
|
||||||
# for details.
|
# for details.
|
||||||
|
|
||||||
|
# This workflow builds the development container image
|
||||||
|
# Triggers:
|
||||||
|
# - Nightly scheduled builds (2 AM UTC)
|
||||||
|
# - Push/PR to develop with relevant file changes
|
||||||
|
# Skips:
|
||||||
|
# - Documentation-only changes
|
||||||
|
# - Web-only changes (web/** without Go changes)
|
||||||
|
|
||||||
name: Build development container
|
name: Build development container
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -9,9 +17,25 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- develop
|
- develop
|
||||||
|
paths:
|
||||||
|
- '**/*.go'
|
||||||
|
- 'go.mod'
|
||||||
|
- 'go.sum'
|
||||||
|
- 'Dockerfile'
|
||||||
|
- 'Earthfile'
|
||||||
|
- 'build/**'
|
||||||
|
- '.github/workflows/container.yaml'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- develop
|
- develop
|
||||||
|
paths:
|
||||||
|
- '**/*.go'
|
||||||
|
- 'go.mod'
|
||||||
|
- 'go.sum'
|
||||||
|
- 'Dockerfile'
|
||||||
|
- 'Earthfile'
|
||||||
|
- 'build/**'
|
||||||
|
- '.github/workflows/container.yaml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Earthly:
|
Earthly:
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
# This workflow checks CSS/SCSS code quality and formatting
|
||||||
|
# Triggers:
|
||||||
|
# - Push/PR with changes to web/ directory
|
||||||
|
# Checks:
|
||||||
|
# - Prettier formatting for CSS/SCSS files
|
||||||
|
# - Stylelint rules for code quality
|
||||||
|
# Note: Only runs when CSS or SCSS files are changed
|
||||||
|
|
||||||
name: CSS Lint and Formatting
|
name: CSS Lint and Formatting
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
# This workflow runs golangci-lint to check Go code quality
|
||||||
|
# Triggers:
|
||||||
|
# - Push/PR with Go file changes
|
||||||
|
# Skips:
|
||||||
|
# - Web-only changes
|
||||||
|
# - Dependabot PRs (separate workflow)
|
||||||
|
# Note: Only reports on new issues to reduce noise
|
||||||
|
|
||||||
name: Lint
|
name: Lint
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
# This workflow runs Go unit tests across multiple OS and Go versions
|
||||||
|
# Triggers:
|
||||||
|
# - Push/PR with Go file changes (*.go, go.mod, go.sum)
|
||||||
|
# - Skips when only web/ directory changes
|
||||||
|
# Test Matrix:
|
||||||
|
# - PRs: Latest Go on Ubuntu only (fast feedback)
|
||||||
|
# - Develop/Main: Full matrix (ensure cross-platform compatibility)
|
||||||
|
|
||||||
name: Go Tests
|
name: Go Tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -12,8 +20,8 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [1.23.x, 1.24.x]
|
go-version: ${{ github.event_name == 'pull_request' && fromJSON('["1.24.x"]') || fromJSON('["1.23.x", "1.24.x"]') }}
|
||||||
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm]
|
os: ${{ github.event_name == 'pull_request' && fromJSON('["ubuntu-latest"]') || fromJSON('["ubuntu-latest", "macos-latest", "windows-latest", "ubuntu-24.04-arm"]') }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
@@ -48,6 +56,8 @@ jobs:
|
|||||||
run: go test ./...
|
run: go test ./...
|
||||||
|
|
||||||
test-bsds:
|
test-bsds:
|
||||||
|
# Only run BSD tests on push events (not PRs) for efficiency
|
||||||
|
if: github.event_name == 'push'
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
@@ -1,3 +1,13 @@
|
|||||||
|
# This workflow tests HLS video streaming functionality
|
||||||
|
# Triggers:
|
||||||
|
# - Push/PR with Go file changes
|
||||||
|
# Skips:
|
||||||
|
# - Web-only changes
|
||||||
|
# Tests:
|
||||||
|
# - Local storage backend
|
||||||
|
# - S3 storage backend (when secrets available)
|
||||||
|
# - Retries up to 3 times for flaky network tests
|
||||||
|
|
||||||
name: HLS tests
|
name: HLS tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
|
# This workflow handles Javascript formatting, linting, testing, and building
|
||||||
|
# Triggers:
|
||||||
|
# - Push/PR with changes to web/ directory
|
||||||
|
# Skips:
|
||||||
|
# - Markdown files
|
||||||
|
# Jobs:
|
||||||
|
# 1. formatting: ESLint and Prettier formatting
|
||||||
|
# 2. unused-code: Knip checks for unused code and dependencies
|
||||||
|
# 3. web-bundle: Builds and bundles the web app (only on develop branch)
|
||||||
|
# Note: Auto-fixes and commits formatting issues on push events
|
||||||
|
|
||||||
name: Javascript
|
name: Javascript
|
||||||
|
|
||||||
# This action works with pull requests and pushes
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
# This workflow checks shell scripts for common issues using shellcheck
|
||||||
|
# Triggers:
|
||||||
|
# - Push/PR to develop with changes to .sh files
|
||||||
|
# Checks:
|
||||||
|
# - All shell scripts recursively
|
||||||
|
# - Reports info-level severity and above
|
||||||
|
# - Follows sourced files with -x flag
|
||||||
|
|
||||||
name: Lint
|
name: Lint
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -20,6 +28,13 @@ jobs:
|
|||||||
container:
|
container:
|
||||||
image: docker.io/ubuntu:24.04
|
image: docker.io/ubuntu:24.04
|
||||||
steps:
|
steps:
|
||||||
|
- id: skip_check
|
||||||
|
uses: fkirc/skip-duplicate-actions@v5
|
||||||
|
with:
|
||||||
|
concurrent_skipping: 'same_content_newer'
|
||||||
|
cancel_others: 'true'
|
||||||
|
skip_after_successful_duplicate: 'true'
|
||||||
|
|
||||||
- name: Check out pull request code
|
- name: Check out pull request code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
|
|||||||
@@ -1,3 +1,14 @@
|
|||||||
|
# This workflow manages internationalization (i18n) with Crowdin
|
||||||
|
# Triggers:
|
||||||
|
# - Hourly schedule to sync translations
|
||||||
|
# - Push with changes to translation files or config
|
||||||
|
# Process:
|
||||||
|
# 1. Extracts translatable strings from source code
|
||||||
|
# 2. Uploads source strings to Crowdin
|
||||||
|
# 3. Downloads translated strings from Crowdin
|
||||||
|
# 4. Creates PR with updated translations
|
||||||
|
# Note: Uses concurrency control to prevent overlapping runs
|
||||||
|
|
||||||
name: Translation job
|
name: Translation job
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
|||||||
Reference in New Issue
Block a user