mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-19 09:06:14 +00:00
Bumps the security-actions group with 1 update: [codecov/codecov-action](https://github.com/codecov/codecov-action). Updates `codecov/codecov-action` from 5 to 6 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/codecov/codecov-action/releases">codecov/codecov-action's releases</a>.</em></p> <blockquote> <h2>v6.0.0</h2> <h2>⚠️ This version introduces support for node24 which make cause breaking changes for systems that do not currently support node24. ⚠️</h2> <h2>What's Changed</h2> <ul> <li>Revert "Revert "build(deps): bump actions/github-script from 7.0.1 to 8.0.0"" by <a href="https://github.com/thomasrockhu-codecov"><code>@thomasrockhu-codecov</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1929">codecov/codecov-action#1929</a></li> <li>Th/6.0.0 by <a href="https://github.com/thomasrockhu-codecov"><code>@thomasrockhu-codecov</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1928">codecov/codecov-action#1928</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/codecov/codecov-action/compare/v5.5.4...v6.0.0">https://github.com/codecov/codecov-action/compare/v5.5.4...v6.0.0</a></p> <h2>v5.5.4</h2> <p>This is a mirror of <code>v5.5.2</code>. <code>v6</code> will be released which requires <code>node24</code></p> <h2>What's Changed</h2> <ul> <li>Revert "build(deps): bump actions/github-script from 7.0.1 to 8.0.0" by <a href="https://github.com/thomasrockhu-codecov"><code>@thomasrockhu-codecov</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1926">codecov/codecov-action#1926</a></li> <li>chore(release): 5.5.4 by <a href="https://github.com/thomasrockhu-codecov"><code>@thomasrockhu-codecov</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1927">codecov/codecov-action#1927</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/codecov/codecov-action/compare/v5.5.3...v5.5.4">https://github.com/codecov/codecov-action/compare/v5.5.3...v5.5.4</a></p> <h2>v5.5.3</h2> <h2>What's Changed</h2> <ul> <li>build(deps): bump actions/github-script from 7.0.1 to 8.0.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/codecov/codecov-action/pull/1874">codecov/codecov-action#1874</a></li> <li>chore(release): bump to 5.5.3 by <a href="https://github.com/thomasrockhu-codecov"><code>@thomasrockhu-codecov</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1922">codecov/codecov-action#1922</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/codecov/codecov-action/compare/v5.5.2...v5.5.3">https://github.com/codecov/codecov-action/compare/v5.5.2...v5.5.3</a></p> <h2>v5.5.2</h2> <h2>What's Changed</h2> <ul> <li>check gpg only when skip-validation = false by <a href="https://github.com/maxweng-sentry"><code>@maxweng-sentry</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1894">codecov/codecov-action#1894</a></li> <li>chore: <code>disable_search</code> alignment by <a href="https://github.com/freemanzMrojo"><code>@freemanzMrojo</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1881">codecov/codecov-action#1881</a></li> <li>chore(release): 5.5.2 by <a href="https://github.com/thomasrockhu-codecov"><code>@thomasrockhu-codecov</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1902">codecov/codecov-action#1902</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/maxweng-sentry"><code>@maxweng-sentry</code></a> made their first contribution in <a href="https://redirect.github.com/codecov/codecov-action/pull/1894">codecov/codecov-action#1894</a></li> <li><a href="https://github.com/freemanzMrojo"><code>@freemanzMrojo</code></a> made their first contribution in <a href="https://redirect.github.com/codecov/codecov-action/pull/1881">codecov/codecov-action#1881</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/codecov/codecov-action/compare/v5.5.1...v5.5.2">https://github.com/codecov/codecov-action/compare/v5.5.1...v5.5.2</a></p> <h2>v5.5.1</h2> <h2>What's Changed</h2> <ul> <li>build(deps): bump ossf/scorecard-action from 2.4.1 to 2.4.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/codecov/codecov-action/pull/1833">codecov/codecov-action#1833</a></li> <li>build(deps): bump github/codeql-action from 3.28.18 to 3.29.9 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/codecov/codecov-action/pull/1861">codecov/codecov-action#1861</a></li> <li>Document a <code>codecov-cli</code> version reference example by <a href="https://github.com/webknjaz"><code>@webknjaz</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1774">codecov/codecov-action#1774</a></li> <li>docs: fix typo in README by <a href="https://github.com/datalater"><code>@datalater</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1866">codecov/codecov-action#1866</a></li> <li>fix: update to use local app/ dir by <a href="https://github.com/thomasrockhu-codecov"><code>@thomasrockhu-codecov</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1872">codecov/codecov-action#1872</a></li> <li>build(deps): bump github/codeql-action from 3.29.9 to 3.29.11 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/codecov/codecov-action/pull/1867">codecov/codecov-action#1867</a></li> <li>build(deps): bump actions/checkout from 4.2.2 to 5.0.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/codecov/codecov-action/pull/1868">codecov/codecov-action#1868</a></li> <li>fix: overwrite pr number on fork by <a href="https://github.com/thomasrockhu-codecov"><code>@thomasrockhu-codecov</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1871">codecov/codecov-action#1871</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md">codecov/codecov-action's changelog</a>.</em></p> <blockquote> <h2>v5.5.2</h2> <h3>What's Changed</h3> <p><strong>Full Changelog</strong>: <a href="https://github.com/codecov/codecov-action/compare/v5.5.1..v5.5.2">https://github.com/codecov/codecov-action/compare/v5.5.1..v5.5.2</a></p> <h2>v5.5.1</h2> <h3>What's Changed</h3> <ul> <li>fix: overwrite pr number on fork by <a href="https://github.com/thomasrockhu-codecov"><code>@thomasrockhu-codecov</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1871">codecov/codecov-action#1871</a></li> <li>build(deps): bump actions/checkout from 4.2.2 to 5.0.0 by <code>@app/dependabot</code> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1868">codecov/codecov-action#1868</a></li> <li>build(deps): bump github/codeql-action from 3.29.9 to 3.29.11 by <code>@app/dependabot</code> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1867">codecov/codecov-action#1867</a></li> <li>fix: update to use local app/ dir by <a href="https://github.com/thomasrockhu-codecov"><code>@thomasrockhu-codecov</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1872">codecov/codecov-action#1872</a></li> <li>docs: fix typo in README by <a href="https://github.com/datalater"><code>@datalater</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1866">codecov/codecov-action#1866</a></li> <li>Document a <code>codecov-cli</code> version reference example by <a href="https://github.com/webknjaz"><code>@webknjaz</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1774">codecov/codecov-action#1774</a></li> <li>build(deps): bump github/codeql-action from 3.28.18 to 3.29.9 by <code>@app/dependabot</code> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1861">codecov/codecov-action#1861</a></li> <li>build(deps): bump ossf/scorecard-action from 2.4.1 to 2.4.2 by <code>@app/dependabot</code> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1833">codecov/codecov-action#1833</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/codecov/codecov-action/compare/v5.5.0..v5.5.1">https://github.com/codecov/codecov-action/compare/v5.5.0..v5.5.1</a></p> <h2>v5.5.0</h2> <h3>What's Changed</h3> <ul> <li>feat: upgrade wrapper to 0.2.4 by <a href="https://github.com/jviall"><code>@jviall</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1864">codecov/codecov-action#1864</a></li> <li>Pin actions/github-script by Git SHA by <a href="https://github.com/martincostello"><code>@martincostello</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1859">codecov/codecov-action#1859</a></li> <li>fix: check reqs exist by <a href="https://github.com/joseph-sentry"><code>@joseph-sentry</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1835">codecov/codecov-action#1835</a></li> <li>fix: Typo in README by <a href="https://github.com/spalmurray"><code>@spalmurray</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1838">codecov/codecov-action#1838</a></li> <li>docs: Refine OIDC docs by <a href="https://github.com/spalmurray"><code>@spalmurray</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1837">codecov/codecov-action#1837</a></li> <li>build(deps): bump github/codeql-action from 3.28.17 to 3.28.18 by <code>@app/dependabot</code> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1829">codecov/codecov-action#1829</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/codecov/codecov-action/compare/v5.4.3..v5.5.0">https://github.com/codecov/codecov-action/compare/v5.4.3..v5.5.0</a></p> <h2>v5.4.3</h2> <h3>What's Changed</h3> <ul> <li>build(deps): bump github/codeql-action from 3.28.13 to 3.28.17 by <code>@app/dependabot</code> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1822">codecov/codecov-action#1822</a></li> <li>fix: OIDC on forks by <a href="https://github.com/joseph-sentry"><code>@joseph-sentry</code></a> in <a href="https://redirect.github.com/codecov/codecov-action/pull/1823">codecov/codecov-action#1823</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/codecov/codecov-action/compare/v5.4.2..v5.4.3">https://github.com/codecov/codecov-action/compare/v5.4.2..v5.4.3</a></p> <h2>v5.4.2</h2> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/codecov/codecov-action/commit/57e3a136b779b570ffcdbf80b3bdc90e7fab3de2"><code>57e3a13</code></a> Th/6.0.0 (<a href="https://redirect.github.com/codecov/codecov-action/issues/1928">#1928</a>)</li> <li><a href="https://github.com/codecov/codecov-action/commit/f67d33dda8a42b51c42a8318a1f66468119e898b"><code>f67d33d</code></a> Revert "Revert "build(deps): bump actions/github-script from 7.0.1 to 8.0.0""...</li> <li>See full diff in <a href="https://github.com/codecov/codecov-action/compare/v5...v6">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
350 lines
10 KiB
YAML
350 lines
10 KiB
YAML
name: CI
|
||
|
||
permissions:
|
||
contents: read
|
||
|
||
on:
|
||
push:
|
||
branches: [main]
|
||
pull_request:
|
||
branches: [main]
|
||
workflow_dispatch:
|
||
|
||
jobs:
|
||
test:
|
||
name: Test
|
||
runs-on: ubuntu-latest
|
||
|
||
steps:
|
||
- name: Checkout code
|
||
uses: actions/checkout@v6
|
||
|
||
- name: Set up Go
|
||
uses: actions/setup-go@v6
|
||
with:
|
||
go-version-file: "go.mod"
|
||
|
||
- name: Cache Go modules
|
||
uses: actions/cache@v5
|
||
with:
|
||
path: |
|
||
~/.cache/go-build
|
||
~/go/pkg/mod
|
||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.mod') }}-${{ hashFiles('**/go.sum') }}
|
||
restore-keys: |
|
||
${{ runner.os }}-go-
|
||
|
||
- name: Download dependencies
|
||
run: go mod download
|
||
|
||
- name: Verify dependencies
|
||
run: go mod verify
|
||
|
||
- name: Run tests
|
||
run: go test -v -race -coverprofile=coverage.out ./...
|
||
|
||
- name: Build service
|
||
run: make build-service
|
||
|
||
- name: Run HTTP client integration tests
|
||
run: make test-http-client
|
||
|
||
- name: Upload coverage to Codecov
|
||
uses: codecov/codecov-action@v6
|
||
with:
|
||
file: ./coverage.out
|
||
flags: unittests
|
||
name: codecov-umbrella
|
||
fail_ci_if_error: false
|
||
|
||
lint:
|
||
name: Lint
|
||
runs-on: ubuntu-latest
|
||
|
||
steps:
|
||
- name: Checkout code
|
||
uses: actions/checkout@v6
|
||
|
||
- name: Set up Go
|
||
uses: actions/setup-go@v6
|
||
with:
|
||
go-version-file: "go.mod"
|
||
|
||
- name: Run golangci-lint
|
||
uses: golangci/golangci-lint-action@v9
|
||
with:
|
||
version: latest
|
||
args: --timeout=5m
|
||
|
||
build:
|
||
name: Build
|
||
runs-on: ubuntu-latest
|
||
strategy:
|
||
matrix:
|
||
goos: [linux, darwin, windows]
|
||
goarch: [amd64, arm64]
|
||
exclude:
|
||
# Windows ARM64 builds are experimental
|
||
- goos: windows
|
||
goarch: arm64
|
||
|
||
steps:
|
||
- name: Checkout code
|
||
uses: actions/checkout@v6
|
||
|
||
- name: Set up Go
|
||
uses: actions/setup-go@v6
|
||
with:
|
||
go-version-file: "go.mod"
|
||
|
||
- name: Build CLI
|
||
env:
|
||
GOOS: ${{ matrix.goos }}
|
||
GOARCH: ${{ matrix.goarch }}
|
||
run: |
|
||
output_name="soundtouch-cli-${{ matrix.goos }}-${{ matrix.goarch }}"
|
||
if [ "${{ matrix.goos }}" = "windows" ]; then
|
||
output_name="${output_name}.exe"
|
||
fi
|
||
go build -o "$output_name" ./cmd/soundtouch-cli
|
||
|
||
- name: Upload build artifacts
|
||
uses: actions/upload-artifact@v7
|
||
with:
|
||
name: soundtouch-cli-${{ matrix.goos }}-${{ matrix.goarch }}
|
||
path: soundtouch-cli-*
|
||
|
||
security:
|
||
name: Basic Security Check
|
||
runs-on: ubuntu-latest
|
||
|
||
steps:
|
||
- name: Checkout code
|
||
uses: actions/checkout@v6
|
||
|
||
- name: Set up Go
|
||
uses: actions/setup-go@v6
|
||
with:
|
||
go-version-file: "go.mod"
|
||
|
||
- name: Run basic vulnerability check
|
||
run: |
|
||
go install golang.org/x/vuln/cmd/govulncheck@latest
|
||
govulncheck ./...
|
||
|
||
- name: Security scan reminder
|
||
run: |
|
||
echo "ℹ️ This is a basic security check for CI speed."
|
||
echo "For comprehensive security scanning, see the Security workflow:"
|
||
echo "https://github.com/${{ github.repository }}/actions/workflows/security.yml"
|
||
|
||
docs:
|
||
name: Documentation Check
|
||
runs-on: ubuntu-latest
|
||
|
||
steps:
|
||
- name: Checkout code
|
||
uses: actions/checkout@v6
|
||
|
||
- name: Check documentation links
|
||
uses: gaurav-nelson/github-action-markdown-link-check@v1
|
||
with:
|
||
use-quiet-mode: "yes"
|
||
use-verbose-mode: "yes"
|
||
config-file: ".github/markdown-link-check.json"
|
||
|
||
- name: Warn on pending images
|
||
run: |
|
||
IMAGES=(
|
||
"dashboard-home.png"
|
||
"account-creation.png"
|
||
"account-dashboard.png"
|
||
"usb-remote-services.png"
|
||
"device-discovery.png"
|
||
"device-registration.png"
|
||
"account-migration.png"
|
||
"migration-setup.png"
|
||
"migration-progress.png"
|
||
"migration-health.png"
|
||
"migration-complete.png"
|
||
"backup-setup.png"
|
||
)
|
||
|
||
for img in "${IMAGES[@]}"; do
|
||
if [ ! -f "docs/images/$img" ]; then
|
||
echo "::warning file=docs/guides/MIGRATION-GUIDE.md::Pending image '$img' is missing from docs/images/"
|
||
fi
|
||
done
|
||
|
||
- name: Validate API documentation
|
||
run: |
|
||
# Check that all documented endpoints exist in code
|
||
echo "Validating API documentation consistency..."
|
||
|
||
# Check API cookbook
|
||
if [ -f "docs/reference/API-COOKBOOK.md" ]; then
|
||
echo "✓ API Cookbook exists"
|
||
else
|
||
echo "✗ API Cookbook missing"
|
||
exit 1
|
||
fi
|
||
|
||
# Check getting started guide
|
||
if [ -f "docs/guides/GETTING-STARTED.md" ]; then
|
||
echo "✓ Getting Started guide exists"
|
||
else
|
||
echo "✗ Getting Started guide missing"
|
||
exit 1
|
||
fi
|
||
|
||
integration:
|
||
name: Integration Test
|
||
runs-on: ubuntu-latest
|
||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||
|
||
steps:
|
||
- name: Checkout code
|
||
uses: actions/checkout@v6
|
||
|
||
- name: Set up Go
|
||
uses: actions/setup-go@v6
|
||
with:
|
||
go-version-file: "go.mod"
|
||
|
||
- name: Test CLI build and help
|
||
run: |
|
||
go build -o soundtouch-cli ./cmd/soundtouch-cli
|
||
./soundtouch-cli -help
|
||
|
||
- name: Test library imports
|
||
run: |
|
||
cat > test_import.go << 'EOF'
|
||
package main
|
||
|
||
import (
|
||
"fmt"
|
||
"github.com/gesellix/bose-soundtouch/pkg/client"
|
||
"github.com/gesellix/bose-soundtouch/pkg/models"
|
||
"github.com/gesellix/bose-soundtouch/pkg/discovery"
|
||
"github.com/gesellix/bose-soundtouch/pkg/config"
|
||
)
|
||
|
||
func main() {
|
||
// Test basic client creation
|
||
c := client.NewClientFromHost("192.168.1.100")
|
||
fmt.Printf("Client created for %s\n", c.BaseURL())
|
||
|
||
// Test models can be imported
|
||
var info models.DeviceInfo
|
||
fmt.Printf("DeviceInfo model available: %T\n", info)
|
||
|
||
// Test discovery can be imported
|
||
cfg := config.DefaultConfig()
|
||
service := discovery.NewUnifiedDiscoveryService(cfg)
|
||
fmt.Printf("Discovery service available: %T\n", service)
|
||
|
||
fmt.Println("All imports successful!")
|
||
}
|
||
EOF
|
||
|
||
go run test_import.go
|
||
rm test_import.go
|
||
|
||
docker:
|
||
name: Docker Build
|
||
runs-on: ubuntu-latest
|
||
permissions:
|
||
contents: read
|
||
packages: write
|
||
|
||
steps:
|
||
- name: Checkout code
|
||
uses: actions/checkout@v6
|
||
|
||
- name: Set up Docker Buildx
|
||
uses: docker/setup-buildx-action@v4
|
||
|
||
- name: Log in to GitHub Container Registry
|
||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||
uses: docker/login-action@v4
|
||
with:
|
||
registry: ghcr.io
|
||
username: ${{ github.actor }}
|
||
password: ${{ secrets.GITHUB_TOKEN }}
|
||
|
||
- name: Extract metadata (tags, labels) for Docker
|
||
id: meta
|
||
uses: docker/metadata-action@v6
|
||
with:
|
||
images: ghcr.io/${{ github.repository }}
|
||
tags: |
|
||
type=raw,value=edge,enable=${{ github.ref == 'refs/heads/main' }}
|
||
type=ref,event=pr
|
||
|
||
- name: Build and push Docker image
|
||
uses: docker/build-push-action@v7
|
||
with:
|
||
context: .
|
||
platforms: linux/amd64,linux/arm64,linux/arm64/v8,linux/arm/v7
|
||
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||
tags: ${{ steps.meta.outputs.tags }}
|
||
labels: ${{ steps.meta.outputs.labels }}
|
||
cache-from: type=gha
|
||
cache-to: type=gha,mode=max
|
||
|
||
notify:
|
||
name: Notify Status
|
||
runs-on: ubuntu-latest
|
||
needs: [test, lint, build, security, docs, docker]
|
||
if: always()
|
||
permissions:
|
||
statuses: write
|
||
contents: read
|
||
|
||
steps:
|
||
- name: Check overall status
|
||
run: |
|
||
if [[ "${{ needs.test.result }}" == "success" && \
|
||
"${{ needs.lint.result }}" == "success" && \
|
||
"${{ needs.build.result }}" == "success" && \
|
||
"${{ needs.security.result }}" == "success" && \
|
||
"${{ needs.docs.result }}" == "success" && \
|
||
"${{ needs.docker.result }}" == "success" ]]; then
|
||
echo "✅ All CI checks passed!"
|
||
echo "status=success" >> $GITHUB_OUTPUT
|
||
else
|
||
echo "❌ Some CI checks failed"
|
||
echo "Test: ${{ needs.test.result }}"
|
||
echo "Lint: ${{ needs.lint.result }}"
|
||
echo "Build: ${{ needs.build.result }}"
|
||
echo "Security: ${{ needs.security.result }}"
|
||
echo "Docs: ${{ needs.docs.result }}"
|
||
echo "Docker: ${{ needs.docker.result }}"
|
||
echo "status=failure" >> $GITHUB_OUTPUT
|
||
fi
|
||
id: status
|
||
|
||
- name: Update commit status
|
||
if: always()
|
||
uses: actions/github-script@v8
|
||
with:
|
||
script: |
|
||
try {
|
||
const state = '${{ steps.status.outputs.status }}' === 'success' ? 'success' : 'failure';
|
||
const description = state === 'success' ? 'All checks passed' : 'Some checks failed';
|
||
|
||
await github.rest.repos.createCommitStatus({
|
||
owner: context.repo.owner,
|
||
repo: context.repo.repo,
|
||
sha: context.sha,
|
||
state: state,
|
||
description: description,
|
||
context: 'CI Pipeline'
|
||
});
|
||
|
||
console.log(`✅ Successfully updated commit status to: ${state}`);
|
||
} catch (error) {
|
||
console.log(`⚠️ Failed to update commit status: ${error.message}`);
|
||
// Don't fail the workflow if status update fails
|
||
}
|