Skip to content

Commit

Permalink
rust hello world
Browse files Browse the repository at this point in the history
  • Loading branch information
Sfonxu committed Sep 6, 2024
1 parent efc4440 commit 496c20f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/readme_rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: readme_rust

defaults:
run:
shell: bash

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 13 * * 4'

jobs:
rust:
runs-on: ubuntu-latest
steps:
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/setup-python@v1
with:
python-version: 3.9
- run: pip install -e .
- run: pip install pytest-codeblocks pytest
- run: python -c "import pytest_codeblocks; code=pytest_codeblocks.extract_from_file('README.md'); f=open('readme.rs', 'w'); f.writelines(block.code for block in code if block.syntax=='Rust'); f.close()"
- run: cargo run readme.rs
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ In most use cases of PyMPDATA, the first thing to do is to instantiate the
[``Options``](https://open-atmos.github.io/PyMPDATA/PyMPDATA/options.html) class
with arguments suiting the problem at hand, e.g.:
<details>
<summary>Rust code</summary>
```Rust
fn main() {
writeln!("Hello world!");
}
```
</details>
<details>
<summary>Julia code (click to expand)</summary>

```Julia
Expand Down

0 comments on commit 496c20f

Please sign in to comment.