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 10
10
steps :
11
11
- uses : actions/checkout@v3
12
12
with :
13
+ fetch-depth : 0 # required for make test
13
14
submodules : " recursive"
14
15
15
16
- name : Install host dependencies
25
26
key : ${{ runner.os }}-flatpak-dependencies-${{ github.run_id }}
26
27
restore-keys : |
27
28
${{ 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-
35
29
36
30
- run : mutter --wayland --no-x11 --headless --wayland-display=wayland-0 --virtual-monitor 1280x720 > /tmp/mutter.log 2>&1 &
37
31
- run : make ci
44
38
with :
45
39
path : ~/.local/share/flatpak
46
40
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 1
1
SHELL: =/bin/bash -O globstar
2
- .PHONY : setup lint test ci
2
+ .PHONY : setup test ci
3
3
.DEFAULT_GOAL := ci
4
4
5
5
setup :
6
6
flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
7
7
# flatpak remote-add --user --if-not-exists flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo
8
8
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
9
9
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
-
16
10
format :
17
11
# npx prettier --write src/*/*.json
18
12
flatpak run --command="workbench-cli" --filesystem=host re.sonny.Workbench format javascript src/*/*.js
19
13
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
22
16
flatpak run --command="workbench-cli" --filesystem=host re.sonny.Workbench format blueprint src/*/*.blp
23
17
flatpak run --command="workbench-cli" --filesystem=host re.sonny.Workbench format vala src/*/*.vala
24
18
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 :
26
24
flatpak run --command=" workbench-cli" --filesystem=host re.sonny.Workbench ci src/*
27
25
28
26
ci : setup test
Original file line number Diff line number Diff line change @@ -23,22 +23,6 @@ flatpak override --user --filesystem=$PWD re.sonny.Workbench
23
23
24
24
For more details see [ CONTRIBUTING.md] ( ./CONTRIBUTING.md ) .
25
25
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
-
42
26
## Code of conduct
43
27
44
28
Workbench 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
2
2
3
3
public void main () {
4
4
var picture_one = (Gtk . Picture ) workbench. builder. get_object (" picture_one" );
5
5
var picture_two = (Gtk . Picture ) workbench. builder. get_object (" picture_two" );
6
6
7
- var file = File . new_for_uri(workbench. resolve(" ./image.png" ));
7
+ var file = File . new_for_uri (workbench. resolve (" ./image.png" ));
8
8
9
9
picture_one. file = file;
10
10
picture_two. file = file;
Original file line number Diff line number Diff line change 1
1
#! / usr/ bin/ env - S vala workbench. vala -- pkg gtk4
2
2
3
3
public 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" );
6
6
}
You can’t perform that action at this time.
0 commit comments