Skip to content

test: verify renderer CSS in packaged app #26

test: verify renderer CSS in packaged app

test: verify renderer CSS in packaged app #26

Workflow file for this run

name: ci
on:
workflow_dispatch:
pull_request:
branches:
- dev
- main
push: {}
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
select-builds:
name: select-builds
runs-on: blacksmith-2vcpu-ubuntu-2404
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Select build matrix
id: matrix
shell: bash
run: |
node <<'NODE'
const fs = require("node:fs");
const builds = [
{
label: "windows-x64",
os: "blacksmith-2vcpu-windows-2025",
builder_args: "--win nsis portable --x64",
artifact_paths: "opennow-stable/dist-release/*-x64.exe\n",
},
{
label: "windows-arm64",
os: "blacksmith-2vcpu-windows-2025",
builder_args: "--win nsis portable --arm64",
artifact_paths: "opennow-stable/dist-release/*-arm64.exe\n",
},
{
label: "macos-x64",
os: "blacksmith-6vcpu-macos-15",
builder_args: "--mac dmg zip --x64",
artifact_paths:
"opennow-stable/dist-release/*.dmg\n" +
"opennow-stable/dist-release/*-x64.zip\n",
},
{
label: "macos-arm64",
os: "blacksmith-6vcpu-macos-15",
builder_args: "--mac dmg zip --arm64",
artifact_paths:
"opennow-stable/dist-release/*.dmg\n" +
"opennow-stable/dist-release/*-arm64.zip\n",
},
{
label: "linux-x64",
os: "blacksmith-2vcpu-ubuntu-2404",
builder_args: "--linux AppImage deb --x64",
artifact_paths:
"opennow-stable/dist-release/*-x86_64.AppImage\n" +
"opennow-stable/dist-release/*-amd64.deb\n",
},
{
label: "linux-arm64",
os: "blacksmith-2vcpu-ubuntu-2404-arm",
builder_args: "--linux AppImage deb --arm64",
artifact_paths:
"opennow-stable/dist-release/*-arm64.AppImage\n" +
"opennow-stable/dist-release/*-arm64.deb\n",
},
];
const eventName = process.env.GITHUB_EVENT_NAME;
const baseRef = process.env.GITHUB_BASE_REF;
const isPullRequest = eventName === "pull_request";
const isDevValidationPullRequest = isPullRequest && baseRef === "dev";
const include = isDevValidationPullRequest
? builds.filter(({ label }) =>
label === "windows-x64" || label === "linux-x64" || label === "linux-arm64")
: builds;
fs.appendFileSync(process.env.GITHUB_OUTPUT, `matrix=${JSON.stringify({ include })}\n`);
NODE
build:
name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}
needs: select-builds
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.select-builds.outputs.matrix) }}
defaults:
run:
working-directory: opennow-stable
env:
npm_config_audit: "false"
npm_config_fund: "false"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: opennow-stable/package-lock.json
- name: Setup Rust
if: runner.os == 'Linux'
uses: dtolnay/rust-toolchain@stable
- name: Install Linux native streamer dependencies
if: runner.os == 'Linux'
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
pkg-config \
libx11-dev \
libglib2.0-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-bad1.0-dev \
gstreamer1.0-libav \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-nice \
gstreamer1.0-gl \
gstreamer1.0-x
- name: Install dependencies
run: npm ci
- name: Lint
id: lint
run: npm run lint
- name: Typecheck
id: typecheck
run: npm run typecheck
- name: Test
id: test
run: npm test
- name: Build
id: build
run: npm run build
- name: Test and build Linux native streamer
if: runner.os == 'Linux'
run: |
cargo test --manifest-path ../native/opennow-streamer/Cargo.toml --features gstreamer
npm run native:build
- name: CI summary
if: always()
working-directory: .
shell: bash
run: |
status_icon() {
case "$1" in
success) printf '✅ success' ;;
failure) printf '❌ failure' ;;
cancelled) printf '❌ cancelled' ;;
skipped) printf '⏭️ skipped' ;;
*) printf '❌ %s' "$1" ;;
esac
}
{
echo "## CI Summary"
echo
echo "| Check | Result |"
echo "| --- | --- |"
echo "| Format | ⏭️ skipped/not configured |"
echo "| Lint | $(status_icon '${{ steps.lint.outcome }}') |"
echo "| Typecheck | $(status_icon '${{ steps.typecheck.outcome }}') |"
echo "| Test | $(status_icon '${{ steps.test.outcome }}') |"
echo "| Browser Test | ⏭️ skipped/not configured |"
echo "| Build | $(status_icon '${{ steps.build.outcome }}') |"
echo
echo "Job summary generated at run-time"
} >> "$GITHUB_STEP_SUMMARY"