Skip to content

test(e2e): self-update binary-path regression guard (#428) #1244

test(e2e): self-update binary-path regression guard (#428)

test(e2e): self-update binary-path regression guard (#428) #1244

Workflow file for this run

# This workflow bootstraps @gjsify/cli via the Node-free install.mjs flow
# (Phase F), then builds + tests entirely under stock GJS. ts-for-gir's
# generated TypeScript types are validated in build-validate against the
# committed types-dev submodule.
#
# Runner: ubuntu-latest with a Fedora 43 container. Fedora 43 ships
# gjs 1.86 (SM 140), which is the minimum install.mjs accepts. The
# default ubuntu-latest gjs 1.80 is too old.
name: CI
on:
push:
branches:
- main
paths:
- 'packages/**'
- 'tests/**'
- 'girs/**'
- 'examples/**'
- 'package.json'
- 'gjsify-lock.json'
- '.ts-for-gir.*.rc.js'
- 'tsconfig*.json'
- '.github/workflows/ci.yml'
pull_request:
branches:
- "*"
paths:
- 'packages/**'
- 'tests/**'
- 'girs/**'
- 'examples/**'
- 'package.json'
- 'gjsify-lock.json'
- '.ts-for-gir.*.rc.js'
- 'tsconfig*.json'
- '.github/workflows/ci.yml'
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
container:
image: fedora:43
steps:
- name: Install container prerequisites
run: |
dnf install -y git tar xz findutils curl gjs libsoup3 nodejs
git config --global --add safe.directory "*"
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: false
- name: Checkout types-dev submodule
run: |
git config --global --add safe.directory "*"
git config --global url."https://github.com/".insteadOf "git@github.com:"
git submodule update --init types-dev
- name: Bootstrap @gjsify/cli via install.mjs (Node-free)
run: |
curl -fsSL https://github.com/gjsify/gjsify/releases/latest/download/install.mjs -o /tmp/g.mjs
gjs -m /tmp/g.mjs
rm /tmp/g.mjs
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- run: gjsify --version
- run: gjsify install --immutable
- run: PATH="$PWD/node_modules/.bin:$PATH" gjsify run check
test-units:
runs-on: ubuntu-latest
container:
image: fedora:43
steps:
- name: Install container prerequisites
run: |
dnf install -y git tar xz findutils curl gjs libsoup3 nodejs
git config --global --add safe.directory "*"
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: false
- name: Checkout types-dev submodule
run: |
git config --global --add safe.directory "*"
git config --global url."https://github.com/".insteadOf "git@github.com:"
git submodule update --init types-dev
- name: Bootstrap @gjsify/cli via install.mjs (Node-free)
run: |
curl -fsSL https://github.com/gjsify/gjsify/releases/latest/download/install.mjs -o /tmp/g.mjs
gjs -m /tmp/g.mjs
rm /tmp/g.mjs
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- run: gjsify --version
- run: gjsify install --immutable
- run: PATH="$PWD/node_modules/.bin:$PATH" gjsify run test:tests
# End-to-end suites for the CLI: tarball shape under the production
# packer (`gjsify pack`), `ts-for-gir create` for every scaffold
# template, Node-vs-GJS CLI invocations, install.js / self-update.
# Kept separate from `test-units` so failures are easy to spot
# in the PR-check matrix.
test-e2e:
runs-on: ubuntu-latest
container:
image: fedora:43
steps:
- name: Install container prerequisites
run: |
dnf install -y git tar xz findutils curl gjs libsoup3 nodejs npm
git config --global --add safe.directory "*"
# The e2e suite's `pack.mjs` now uses `gjsify pack` directly
# (matches the production `gjsify run publish:app` chain) +
# walks `package.json#workspaces` globs with Node-native fs,
# so no Yarn / corepack / npm-i-g step is needed.
#
# The `create` e2e subtests for `types-locally` / `types-workspace`
# invoke `ts-for-gir generate Gtk-4.0` inside the scaffolded
# project; generation reads GIR XML from the system catalog
# under `/usr/share/gir-1.0/`. Without these dev packages the
# generate step exits 0 but produces no output (`@types/ not
# generated` assertion fires). Mirrors the GNOME dev libraries
# the `build-validate` job already pulls in.
- name: Install GNOME GIR catalog (for create-test generate subtests)
run: |
dnf install -y \
gobject-introspection-devel \
gtk4-devel \
libadwaita-devel \
cairo-devel \
libsoup3-devel \
pkgconf
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: false
- name: Checkout types-dev submodule
run: |
git config --global --add safe.directory "*"
git config --global url."https://github.com/".insteadOf "git@github.com:"
git submodule update --init types-dev
- name: Bootstrap @gjsify/cli via install.mjs (Node-free)
run: |
curl -fsSL https://github.com/gjsify/gjsify/releases/latest/download/install.mjs -o /tmp/g.mjs
gjs -m /tmp/g.mjs
rm /tmp/g.mjs
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- run: gjsify --version
- run: gjsify install --immutable
- run: PATH="$PWD/node_modules/.bin:$PATH" gjsify run build:app
- run: PATH="$PWD/node_modules/.bin:$PATH" gjsify run build:app:gjs
- run: PATH="$PWD/node_modules/.bin:$PATH" gjsify workspace @ts-for-gir-test/e2e test
build-validate:
runs-on: ubuntu-latest
container:
image: fedora:43
needs: [check, test-units]
steps:
- name: Install container prerequisites
run: |
dnf install -y git tar xz findutils curl gjs libsoup3 nodejs
git config --global --add safe.directory "*"
- name: Checkout repository
uses: actions/checkout@v6
with:
# Skip recursive submodule checkout: the reference-only
# `refs/*` submodules under gitlab.gnome.org regularly 503
# and crash CI even though `build-validate` doesn't read
# them (it only consumes `types-dev` for the generator
# diff). Match the selective pattern the other jobs use.
submodules: false
- name: Checkout types-dev submodule
run: |
git config --global --add safe.directory "*"
git config --global url."https://github.com/".insteadOf "git@github.com:"
git submodule update --init types-dev
- name: Detect changed paths
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
generator:
- 'packages/**'
- 'girs/**'
- '.ts-for-gir.*.rc.js'
- 'gjsify-lock.json'
examples:
- 'examples/**'
- 'packages/**'
- name: Install GNOME development libraries
run: >
dnf install -y
blueprint-compiler
libappindicator-gtk3-devel
libgda-devel
gobject-introspection-devel
gtk3-devel
gtk4-devel
gtksourceview3-devel
libnotify-devel
libsoup-devel
libsoup3-devel
webkit2gtk4.1-devel
libadwaita-devel
mutter-devel
gcr-devel
gnome-desktop4-devel
gnome-shell
gcc
pkgconf
cairo-devel
libdex-devel
- name: Bootstrap @gjsify/cli via install.mjs (Node-free)
run: |
curl -fsSL https://github.com/gjsify/gjsify/releases/latest/download/install.mjs -o /tmp/g.mjs
gjs -m /tmp/g.mjs
rm /tmp/g.mjs
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- run: gjs --version
- run: gjsify --version
- run: gjsify install
- run: PATH="$PWD/node_modules/.bin:$PATH" gjsify run build:types
if: steps.filter.outputs.generator == 'true' || github.event_name == 'workflow_dispatch'
- name: Show diff
if: steps.filter.outputs.generator == 'true' || github.event_name == 'workflow_dispatch'
run: (cd ./types-dev && git diff | cat)
- run: PATH="$PWD/node_modules/.bin:$PATH" gjsify run build:examples
if: steps.filter.outputs.examples == 'true' || github.event_name == 'workflow_dispatch'
- run: PATH="$PWD/node_modules/.bin:$PATH" gjsify run check:examples
if: steps.filter.outputs.examples == 'true' || github.event_name == 'workflow_dispatch'
- run: PATH="$PWD/node_modules/.bin:$PATH" gjsify run test:examples:cli
if: steps.filter.outputs.examples == 'true' || github.event_name == 'workflow_dispatch'
- run: PATH="$PWD/node_modules/.bin:$PATH" gjsify run check:types
if: steps.filter.outputs.generator == 'true' || github.event_name == 'workflow_dispatch'