Skip to content

Commit

Permalink
Use Workbench flathub for testing / CI (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnyp committed Jan 19, 2024
1 parent df7aec0 commit b67ffb3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 15 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

21 changes: 11 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@ SHELL:=/bin/bash -O globstar
.DEFAULT_GOAL := ci

setup:
cd Workbench && make setup
flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
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

lint:
# Rust
./Workbench/build-aux/fun rustfmt --check --edition 2021 demos/**/*.rs
flatpak run --command="/usr/lib/sdk/rust-stable/bin/rustfmt" --filesystem=host re.sonny.Workbench --check --edition 2021 demos/**/*.rs
# Python
./Workbench/build-aux/fun black --check demos/**/*.py
flatpak run --command="black" --filesystem=host re.sonny.Workbench --check demos/**/*.py

format:
# npx prettier --write demos/**/*.json
./Workbench/build-aux/fun workbench-cli format javascript demos/**/*.js
./Workbench/build-aux/fun workbench-cli format css demos/**/*.css
./Workbench/build-aux/fun black demos/**/*.py
./Workbench/build-aux/fun rustfmt --edition 2021 demos/**/*.rs
./Workbench/build-aux/fun workbench-cli format blueprint demos/**/*.blp
./Workbench/build-aux/fun workbench-cli format vala demos/**/*.vala
flatpak run --command="workbench-cli" --filesystem=host re.sonny.Workbench format javascript demos/**/*.js
flatpak run --command="workbench-cli" --filesystem=host re.sonny.Workbench format css demos/**/*.css
flatpak run --command="black" --filesystem=host re.sonny.Workbench demos/**/*.py
flatpak run --command="/usr/lib/sdk/rust-stable/bin/rustfmt" --filesystem=host re.sonny.Workbench --edition 2021 demos/**/*.rs
flatpak run --command="workbench-cli" --filesystem=host re.sonny.Workbench format blueprint demos/**/*.blp
flatpak run --command="workbench-cli" --filesystem=host re.sonny.Workbench format vala demos/**/*.vala

test: lint
./Workbench/build-aux/fun workbench-cli ci demos/*
flatpak run --command="workbench-cli" --filesystem=host re.sonny.Workbench ci demos/*

ci: setup test

Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Demos

This is the repository containing the Library demos of [Workbench](https://github.com/sonnyp/Workbench).
This is the repository containing the Library demos of [Workbench](https://github.com/workbenchdev/Workbench).

## Contributing

Expand All @@ -11,6 +11,8 @@ This is the repository containing the Library demos of [Workbench](https://githu
5. Make changes
6. Open a pull request

---

⚠️ If you are contributing to Rust please do the following:

```sh
Expand All @@ -21,6 +23,22 @@ flatpak override --user --filesystem=$PWD re.sonny.Workbench

For more details see [CONTRIBUTING.md](./CONTRIBUTING.md).

## Testing

Please make sure to test your changes manually.

You can run automated tests for a specific demo locally with

```sh
flatpak run --command="workbench-cli" --filesystem=$PWD/demos re.sonny.Workbench ci demos/Welcome
```

Or run all the tests locally with

```sh
make ci
```

## Code of conduct

Workbench follows the [GNOME Code of Conduct](https://conduct.gnome.org/).
Expand Down
1 change: 0 additions & 1 deletion Workbench
Submodule Workbench deleted from 58b40d

0 comments on commit b67ffb3

Please sign in to comment.