Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gitpod support #4700

Closed
wants to merge 6 commits into from
Closed
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
34 changes: 34 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
github:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like adding this new file to the root. In theory, gitpod should behave like bors and allow this file to live in the .github folder.

I would assume it's an advertising feature for gitpod to not allow it to live in a non-root folder, but that's a scummy practise. See also gitpod-io/gitpod#729, which still doesn't suggest to use .github.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cart for putting a comment through.

I don't expect much movement though, unfortunately.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cart for putting a comment through.

I don't expect much movement though, unfortunately.

prebuilds:
master: true
branches: true
pullRequests: true
pullRequestsFromForks: true
addCheck: false
addComment: false
addBadge: true
Comment on lines +7 to +9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like the check version would be less intrusive here, if it correctly links to the same point. Looking at the docs, the badge doesn't look too bad though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addCheck would make CI fail if pre-building for gitpod fails
addComment would add a comment to every PR
addBadge adds a button on every PR, which doesn't send notifications


tasks:
- name: Start web server
command: python3 -m http.server --directory examples/wasm

- name: Setup rust-analyzer for wasm target
before: |
sudo apt-get install --no-install-recommends -yq libasound2-dev libudev-dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're building for wasm, why is this needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for rust-analyzer. I guess I could add config to have it work in wasm by default, but I'm not sure where that would live

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is rust-analyzer.cargo.target at wherever gitpod allow configuring rust-analyzer. For vscode that would be .vscode/settings.json.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I added the file correctly, but still keeping the linux dependencies because they add almost nothing to the build time and they are still helpful

init: |
mkdir .vscode
echo "{\"rust-analyzer.cargo.target\":\"wasm32-unknown-unknown\"}" > .vscode/settings.json

- name: Install wasm tooling
before: |
rustup update
rustup target add wasm32-unknown-unknown
cargo install cargo-quickinstall
cargo quickinstall wasm-bindgen-cli
cargo quickinstall cargo-watch
init: |
cargo run -p build-wasm-example -- lighting
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to pre-suppose which example is relevant. It would be very cool, for example, to select a relevant example which has been updated by the given PR. Or at least to have a dropdown with all the examples.

OTOH, this might be the best possible option within the technical constraints of the gitpod platform.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lighting example is one where a lot of things could go wrong, so it's a good first pick. My goal was mostly to cache everything for a wasm build, so why not go all the way to build an example

Copy link

@loujaybee loujaybee Jun 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

select a relevant example which has been updated by the given PR. Or at least to have a dropdown with all the examples.

Thought: You could do this via a regular HTML form (hosted wherever), or a series of gitpod links hardcoded with an environment variable that triggers if/else logic in your configuration

See: https://www.gitpod.io/docs/environment-variables#providing-one-time-environment-variables-via-url

An example of a community doing this is drupal / drupalpod: https://github.com/shaal/DrupalPod


vscode:
extensions:
- matklad.rust-analyzer