chore(ci): update CI to run more less often and more efficient

This commit is contained in:
Gabe Kangas
2025-10-06 20:18:07 -07:00
parent 9b15da74d9
commit 7800afd95a
12 changed files with 165 additions and 4 deletions
@@ -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
on:
+26
View File
@@ -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
+19
View File
@@ -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
on:
push:
@@ -16,6 +28,13 @@ jobs:
if: github.repository == 'owncast/owncast'
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
uses: actions/checkout@v5
if: github.event_name == 'pull_request'
+11 -1
View File
@@ -1,6 +1,16 @@
# .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'
on:
+24
View File
@@ -1,6 +1,14 @@
# See https://docs.earthly.dev/ci-integration/vendor-specific-guides/gh-actions-integration
# 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
on:
@@ -9,9 +17,25 @@ on:
push:
branches:
- develop
paths:
- '**/*.go'
- 'go.mod'
- 'go.sum'
- 'Dockerfile'
- 'Earthfile'
- 'build/**'
- '.github/workflows/container.yaml'
pull_request:
branches:
- develop
paths:
- '**/*.go'
- 'go.mod'
- 'go.sum'
- 'Dockerfile'
- 'Earthfile'
- 'build/**'
- '.github/workflows/container.yaml'
jobs:
Earthly:
+8
View File
@@ -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
on:
+8
View File
@@ -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
on:
push:
+12 -2
View File
@@ -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
on:
@@ -12,8 +20,8 @@ jobs:
test:
strategy:
matrix:
go-version: [1.23.x, 1.24.x]
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm]
go-version: ${{ github.event_name == 'pull_request' && fromJSON('["1.24.x"]') || fromJSON('["1.23.x", "1.24.x"]') }}
os: ${{ github.event_name == 'pull_request' && fromJSON('["ubuntu-latest"]') || fromJSON('["ubuntu-latest", "macos-latest", "windows-latest", "ubuntu-24.04-arm"]') }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
@@ -48,6 +56,8 @@ jobs:
run: go test ./...
test-bsds:
# Only run BSD tests on push events (not PRs) for efficiency
if: github.event_name == 'push'
runs-on: macos-latest
strategy:
matrix:
+10
View File
@@ -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
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
# This action works with pull requests and pushes
on:
push:
paths:
+15
View File
@@ -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
on:
@@ -20,6 +28,13 @@ jobs:
container:
image: docker.io/ubuntu:24.04
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
uses: actions/checkout@v5
if: github.event_name == 'pull_request'
+11
View File
@@ -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
on: