File tree Expand file tree Collapse file tree 5 files changed +13
-43
lines changed
Expand file tree Collapse file tree 5 files changed +13
-43
lines changed Original file line number Diff line number Diff line change 1010 steps :
1111 - uses : actions/checkout@v3
1212 with :
13+ fetch-depth : 0 # required for make test
1314 submodules : " recursive"
1415
1516 - name : Install host dependencies
2526 key : ${{ runner.os }}-flatpak-dependencies-${{ github.run_id }}
2627 restore-keys : |
2728 ${{ runner.os }}-flatpak-dependencies-
28- - name : Restore .flatpak-builder
29- uses : actions/cache/restore@v3
30- with :
31- path : Workbench/.flatpak-builder
32- key : ${{ runner.os }}-flatpak-builder-${{ github.run_id }}
33- restore-keys : |
34- ${{ runner.os }}-flatpak-builder-
3529
3630 - run : mutter --wayland --no-x11 --headless --wayland-display=wayland-0 --virtual-monitor 1280x720 > /tmp/mutter.log 2>&1 &
3731 - run : make ci
4438 with :
4539 path : ~/.local/share/flatpak
4640 key : ${{ runner.os }}-flatpak-dependencies-${{ github.run_id }}
47- - name : Save .flatpak-builder
48- uses : actions/cache/save@v3
49- if : always()
50- with :
51- path : Workbench/.flatpak-builder
52- key : ${{ runner.os }}-flatpak-builder-${{ github.run_id }}
Original file line number Diff line number Diff line change 11SHELL: =/bin/bash -O globstar
2- .PHONY : setup lint test ci
2+ .PHONY : setup test ci
33.DEFAULT_GOAL := ci
44
55setup :
66 flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
77# flatpak remote-add --user --if-not-exists flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo
88 flatpak install --or-update --user --noninteractive flathub re.sonny.Workbench org.freedesktop.Sdk.Extension.rust-stable//23.08 org.freedesktop.Sdk.Extension.vala//23.08
99
10- lint :
11- # Rust
12- flatpak run --command="/usr/lib/sdk/rust-stable/bin/rustfmt" --filesystem=host re.sonny.Workbench --check --edition 2021 src/*/*.rs
13- # Python
14- # flatpak run --command="ruff" --filesystem=host re.sonny.Workbench check --config=../src/langs/python/ruff.toml src/*/*.py
15-
1610format :
1711# npx prettier --write src/*/*.json
1812 flatpak run --command="workbench-cli" --filesystem=host re.sonny.Workbench format javascript src/*/*.js
1913 flatpak run --command="workbench-cli" --filesystem=host re.sonny.Workbench format css src/*/*.css
20- # flatpak run --command="ruff " --filesystem=host re.sonny.Workbench format --config=../src/langs/ python/ruff.toml src/* */*.py
21- flatpak run --command="/usr/lib/sdk/rust-stable/bin/rustfmt " --filesystem=host re.sonny.Workbench --edition 2021 src/*/*.rs
14+ flatpak run --command="workbench-cli " --filesystem=host re.sonny.Workbench format python src/*/*.py
15+ flatpak run --command="workbench-cli " --filesystem=host re.sonny.Workbench format rust src/*/*.rs
2216 flatpak run --command="workbench-cli" --filesystem=host re.sonny.Workbench format blueprint src/*/*.blp
2317 flatpak run --command="workbench-cli" --filesystem=host re.sonny.Workbench format vala src/*/*.vala
2418
25- test : lint
19+ test :
20+ # list folders that have changed and run workbench-cli ci on them
21+ git diff --dirstat=files,0 origin/main src | sed 's/^[ 0-9.]\+% //g' | uniq | xargs -d '\n' flatpak run --command="workbench-cli" --filesystem=host re.sonny.Workbench ci
22+
23+ all :
2624 flatpak run --command=" workbench-cli" --filesystem=host re.sonny.Workbench ci src/*
2725
2826ci : setup test
Original file line number Diff line number Diff line change @@ -23,22 +23,6 @@ flatpak override --user --filesystem=$PWD re.sonny.Workbench
2323
2424For more details see [ CONTRIBUTING.md] ( ./CONTRIBUTING.md ) .
2525
26- ## Testing
27-
28- Please make sure to test your changes manually.
29-
30- You can run automated tests for a specific demo locally with
31-
32- ``` sh
33- flatpak run --command=" workbench-cli" --filesystem=$PWD /src re.sonny.Workbench ci src/Welcome
34- ```
35-
36- Or run all the tests locally with
37-
38- ``` sh
39- make ci
40- ```
41-
4226## Code of conduct
4327
4428Workbench follows the [ GNOME Code of Conduct] ( https://conduct.gnome.org/ ) .
Original file line number Diff line number Diff line change 1- #! / usr/ bin/ env - S vala workbench. vala -- pkg gtk4
1+ #! / usr/ bin/ env - S vala workbench. vala -- pkg gtk4
22
33public void main () {
44 var picture_one = (Gtk . Picture ) workbench. builder. get_object (" picture_one" );
55 var picture_two = (Gtk . Picture ) workbench. builder. get_object (" picture_two" );
66
7- var file = File . new_for_uri(workbench. resolve(" ./image.png" ));
7+ var file = File . new_for_uri (workbench. resolve (" ./image.png" ));
88
99 picture_one. file = file;
1010 picture_two. file = file;
Original file line number Diff line number Diff line change 11#! / usr/ bin/ env - S vala workbench. vala -- pkg gtk4
22
33public void main () {
4- var basic_label = workbench. builder. get_object(" basic_label" );
5- basic_label. add_css_class(" css_text" );
4+ var basic_label = ( Gtk . Label ) workbench. builder. get_object (" basic_label" );
5+ basic_label. add_css_class (" css_text" );
66}
You can’t perform that action at this time.
0 commit comments