Skip to content
Merged

Foundry #1024

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
src/lib
troll
flatpak
demos
3 changes: 3 additions & 0 deletions .foundry/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tmp/
user/
cache/
17 changes: 15 additions & 2 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
CI:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Install host dependencies
run: |
sudo apt-get update
sudo apt-get install flatpak mutter flatpak-builder
sudo apt-get install flatpak mutter flatpak-builder foundry

# Restore caches
- name: Restore Flatpak dependencies
Expand All @@ -40,6 +40,13 @@ jobs:
key: ${{ runner.os }}-flatpak-builder-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-flatpak-builder-
- name: Restore .foundry
uses: actions/cache/restore@v3
with:
path: .foundry
key: ${{ runner.os }}-foundry-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-foundry-

- run: mutter --wayland --no-x11 --headless --wayland-display=wayland-0 --virtual-monitor 1280x720 > /tmp/mutter.log 2>&1 &
- run: make ci
Expand All @@ -58,3 +65,9 @@ jobs:
with:
path: .flatpak-builder
key: ${{ runner.os }}-flatpak-builder-${{ github.run_id }}
- name: Save .foundry
uses: actions/cache/save@v3
if: always()
with:
path: .foundry
key: ${{ runner.os }}-foundry-${{ github.run_id }}
23 changes: 0 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1 @@
.flatpak
.flatpak-builder
build
builddir
/flatpak
node_modules
repo
install
.eslintcache
*~
*.compiled
*.flatpak
.fenv
.venv
__pycache__
*.pyc
*.gresource
.frun

# IDEs / editors
.idea

target
.foundry
10 changes: 0 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,6 @@ See also

Workbench doesn't currently support translations for its user interface. GNOME documentation is only available in English and we do not want to mislead non-English speakers.

<!--
If you'd like to help translating Workbench into your language, please head over to [Weblate](https://hosted.weblate.org/engage/workbench/).
<a href="https://hosted.weblate.org/engage/workbench/">
<img src="https://hosted.weblate.org/widgets/workbench/-/workbench/multi-auto.svg" alt="Translation status" />
</a>
Thank you for your help!
-->

## Troubleshooting

### The app won't build/run anymore - even on clean `main`
Expand Down
48 changes: 14 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
SHELL:=/bin/bash -O globstar
ROOT := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
.PHONY: setup build lint unit test ci sandbox flatpak
.DEFAULT_GOAL := setup

Expand All @@ -13,41 +14,38 @@ setup:
@echo "✅ You can use "make build" to build Workbench"

stable:
# flatpak --user run org.flatpak.Builder --delete-build-dirs --disable-updates --build-only --ccache --force-clean flatpak build-aux/re.sonny.Workbench.json
flatpak-builder --delete-build-dirs --disable-updates --build-only --ccache --force-clean flatpak build-aux/re.sonny.Workbench.json
foundry build build-aux/re.sonny.Workbench.json

devel:
# flatpak --user run org.flatpak.Builder --delete-build-dirs --disable-updates --build-only --ccache --force-clean flatpak build-aux/re.sonny.Workbench.Devel.json
flatpak-builder --delete-build-dirs --disable-updates --build-only --ccache --force-clean flatpak build-aux/re.sonny.Workbench.Devel.json

foundry build build-aux/re.sonny.Workbench.Devel.json

build: devel

cli:
./troll/gjspack/bin/gjspack src/cli/main.js --appid=re.sonny.Workbench.cli --prefix=/re/sonny/Workbench --resource-root=src/ --no-executable flatpak/files/share/re.sonny.Workbench.cli/
cp src/cli/bin.js flatpak/files/bin/workbench-cli
cp src/cli/bin.js flatpak/files/bin/workbench-cli # FIXME

lint:
# JavaScript
./node_modules/.bin/eslint --max-warnings=0 src
# Rust
./build-aux/fun rustfmt --check --edition 2021 src/**/*.rs
foundry devenv -- rustfmt --check --edition 2021 $(ROOT)/src/**/*.rs
# Python
./build-aux/fun ruff check --config=src/langs/python/ruff.toml src/**/*.py
./build-aux/fun ruff format --config=src/langs/python/ruff.toml --check src/**/*.py
foundry devenv -- ruff check --config=$(ROOT)/src/langs/python/ruff.toml $(ROOT)/src/**/*.py
foundry devenv -- ruff format --config=$(ROOT)/src/langs/python/ruff.toml --check $(ROOT)/src/**/*.py
# Blueprint
./build-aux/fun blueprint-compiler format src/**/*.blp
./build-aux/fun workbench-cli check blueprint src/**/*.blp
foundry devenv -- blueprint-compiler format $(ROOT)/src/**/*.blp
foundry run -- workbench-cli check blueprint $(ROOT)/src/**/*.blp
# Vala
# ./build-aux/fun workbench-cli check vala src/**/*.vala
# foundry run -- workbench-cli check vala $(ROOT)/src/**/*.vala
# CSS
./build-aux/fun workbench-cli check css src/**/*.css
foundry run -- workbench-cli check css $(ROOT)/src/**/*.css
# Flatpak manifests
flatpak run --user --command=flatpak-builder-lint org.flatpak.Builder manifest --exceptions --user-exceptions ./build-aux/exceptions.json build-aux/re.sonny.Workbench.json
flatpak run --user --command=flatpak-builder-lint org.flatpak.Builder manifest --exceptions --user-exceptions ./build-aux/exceptions.json build-aux/re.sonny.Workbench.Devel.json

unit:
./build-aux/fun gjs -m ./troll/tst/bin.js test/*.test.js
foundry run -- gjs -m $(ROOT)/troll/tst/bin.js $(ROOT)/test/*.test.js
#./build-aux/wip/run.js build-aux/re.sonny.Workbench.Devel.json -- gjs -m ./troll/tst/bin.js test/*.test.js

# https://github.com/ximion/appstream/issues/398#issuecomment-1129454985
Expand All @@ -61,20 +59,13 @@ unit:
# flatpak run --env=G_DEBUG=fatal-criticals --command=appstream-util org.flatpak.Builder validate data/app.metainfo.xml

test: unit lint
./build-aux/fun workbench-cli ci demos/src/Welcome
foundry run -- workbench-cli ci $(ROOT)/demos/src/Welcome
# ./build-aux/wip/run.js build-aux/re.sonny.Workbench.Devel.json -- workbench-cli ci demos/src/Welcome/

ci: setup build test
# See Permissions.js
# flatpak override --user --share=network --socket=pulseaudio --device=input re.sonny.Workbench.Devel
./build-aux/fun workbench-cli ci demos/src/*

# Note that if you have Sdk extensions installed they will be used
# make sure to test without the sdk extensions installed
sandbox: setup
flatpak run org.flatpak.Builder --ccache --user --install --force-clean flatpak build-aux/re.sonny.Workbench.Devel.json
# flatpak remove --noninteractive org.freedesktop.Sdk.Extension.rust-stable//25.08 org.freedesktop.Sdk.Extension.vala//25.08 org.freedesktop.Sdk.Extension.llvm20//25.08
flatpak run --command="bash" re.sonny.Workbench.Devel
foundry run -- workbench-cli ci $(ROOT)/demos/src/*

flatpak:
flatpak run org.flatpak.Builder --ccache --force-clean flatpak build-aux/re.sonny.Workbench.Devel.json
Expand All @@ -83,14 +74,3 @@ flatpak:
flatpak run --command="desktop-file-validate" --filesystem=host:ro org.freedesktop.Sdk//25.08 flatpak/files/share/applications/re.sonny.Workbench.Devel.desktop
# appstreamcli validate --override=release-time-missing=info /path/to/your/app.metainfo.xml
flatpak run org.flatpak.Builder --run flatpak build-aux/re.sonny.Workbench.Devel.json bash

# Sync with .gitignore
clean:
rm -f re.sonny.Workbench.Devel.flatpak
rm -f re.sonny.Workbench.flatpak
rm -rf _build
rm -rf .flatpak
rm -rf .flatpak-builder
rm -rf flatpak
rm -rf flatpak-builder
rm -rf repo
2 changes: 1 addition & 1 deletion Workbench.doap
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<maintainer>
<foaf:Person>
<foaf:name>Sonny Piers</foaf:name>
<foaf:mbox rdf:resource="mailto:sonnyp@gnome.org" />
<foaf:mbox rdf:resource="mailto:workbench@sonny.re" />
<gnome:userid>sonnyp</gnome:userid>
<foaf:account>
<foaf:OnlineAccount>
Expand Down
5 changes: 0 additions & 5 deletions build-aux/fun

This file was deleted.

Loading
Loading