From b0b170a311cbbde108c13b62898b434dfe73d1a6 Mon Sep 17 00:00:00 2001
From: Felix Hekhorn
Date: Wed, 22 May 2024 11:05:27 +0300
Subject: [PATCH 1/4] Add Rust unit tests
---
.github/workflows/unittests-rust.yml | 27 +++++++++++++++++++++++++++
pyproject.toml | 6 ++++++
pyproject.toml.patch | 13 -------------
3 files changed, 33 insertions(+), 13 deletions(-)
create mode 100644 .github/workflows/unittests-rust.yml
diff --git a/.github/workflows/unittests-rust.yml b/.github/workflows/unittests-rust.yml
new file mode 100644
index 000000000..d4bdaf5f8
--- /dev/null
+++ b/.github/workflows/unittests-rust.yml
@@ -0,0 +1,27 @@
+name: Rust unit tests
+
+on:
+ push:
+ # TODO: remove branches
+ branches: ["*"]
+
+jobs:
+ test-rust:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ # - name: Install and configure Poetry
+ # uses: snok/install-poetry@v1
+ - name: Install stable toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ profile: minimal
+ toolchain: stable
+ override: true
+ - name: Install task runner
+ run: pip install poethepoet
+ - name: Run Rust unit tests
+ run: |
+ # poetry install
+ poe rtest
diff --git a/pyproject.toml b/pyproject.toml
index 7404d8711..173e7fc8f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -124,6 +124,12 @@ asv-publish = "asv publish --config benchmarks/asv.conf.json"
asv-show = "asv show --config benchmarks/asv.conf.json"
asv-clean = { "shell" = "rm -rf benchmarks/env benchmarks/html benchmarks/results" }
asv = ["asv-run", "asv-publish", "asv-preview"]
+compile = "pip install -e crates/eko/"
+rdocs.cmd = "cargo doc --workspace --manifest-path crates/Cargo.toml --no-deps"
+rdocs.env = { RUSTDOCFLAGS = "--html-in-header katex-header.html" }
+rdocs-view = "xdg-open crates/target/doc/ekors/index.html"
+rdocs-clean = "rm -rf crates/target/doc/"
+rtest = "cargo test --workspace --manifest-path crates/Cargo.toml"
[tool.pytest.ini_options]
testpaths = ['tests/', 'benchmarks/']
diff --git a/pyproject.toml.patch b/pyproject.toml.patch
index 8e9119a23..f415c7119 100644
--- a/pyproject.toml.patch
+++ b/pyproject.toml.patch
@@ -25,16 +25,3 @@ index 7404d871..a1e3ae66 100644
[tool.poetry]
name = "eko"
-@@ -124,6 +138,12 @@ asv-publish = "asv publish --config benchmarks/asv.conf.json"
- asv-show = "asv show --config benchmarks/asv.conf.json"
- asv-clean = { "shell" = "rm -rf benchmarks/env benchmarks/html benchmarks/results" }
- asv = ["asv-run", "asv-publish", "asv-preview"]
-+compile = "pip install -e crates/eko/"
-+rdocs.cmd = "cargo doc --workspace --manifest-path crates/Cargo.toml --no-deps"
-+rdocs.env = { RUSTDOCFLAGS = "--html-in-header katex-header.html" }
-+rdocs-view = "xdg-open crates/target/doc/ekors/index.html"
-+rdocs-clean = "rm -rf crates/target/doc/"
-+rtest = "cargo test --workspace --manifest-path crates/Cargo.toml"
-
- [tool.pytest.ini_options]
- testpaths = ['tests/', 'benchmarks/']
From ffc7ca13f947320e01c178563253e4b285670aca Mon Sep 17 00:00:00 2001
From: Felix Hekhorn
Date: Wed, 22 May 2024 11:18:17 +0300
Subject: [PATCH 2/4] Cleanup and add badge
---
.github/workflows/unittests-rust.yml | 3 ---
README.md | 1 +
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/.github/workflows/unittests-rust.yml b/.github/workflows/unittests-rust.yml
index d4bdaf5f8..f412f458e 100644
--- a/.github/workflows/unittests-rust.yml
+++ b/.github/workflows/unittests-rust.yml
@@ -11,8 +11,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- # - name: Install and configure Poetry
- # uses: snok/install-poetry@v1
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
@@ -23,5 +21,4 @@ jobs:
run: pip install poethepoet
- name: Run Rust unit tests
run: |
- # poetry install
poe rtest
diff --git a/README.md b/README.md
index 8344d4cb1..aef72ca2f 100644
--- a/README.md
+++ b/README.md
@@ -3,6 +3,7 @@
+
From 6644f6db83cc8d172f29d3c4b78437e77b335bc4 Mon Sep 17 00:00:00 2001
From: Felix Hekhorn
Date: Wed, 22 May 2024 13:46:25 +0300
Subject: [PATCH 3/4] Use default rust
---
.github/workflows/unittests-rust.yml | 6 ------
1 file changed, 6 deletions(-)
diff --git a/.github/workflows/unittests-rust.yml b/.github/workflows/unittests-rust.yml
index f412f458e..7681762b2 100644
--- a/.github/workflows/unittests-rust.yml
+++ b/.github/workflows/unittests-rust.yml
@@ -11,12 +11,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- - name: Install stable toolchain
- uses: actions-rs/toolchain@v1
- with:
- profile: minimal
- toolchain: stable
- override: true
- name: Install task runner
run: pip install poethepoet
- name: Run Rust unit tests
From 271812163f3789c69d756119dc07bce4a96fef34 Mon Sep 17 00:00:00 2001
From: Felix Hekhorn
Date: Wed, 22 May 2024 13:48:46 +0300
Subject: [PATCH 4/4] Activate rust unit test CI
---
.github/workflows/unittests-rust.yml | 5 +----
.github/workflows/unittests.yml | 2 +-
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/unittests-rust.yml b/.github/workflows/unittests-rust.yml
index 7681762b2..9cce3048d 100644
--- a/.github/workflows/unittests-rust.yml
+++ b/.github/workflows/unittests-rust.yml
@@ -1,9 +1,6 @@
name: Rust unit tests
-on:
- push:
- # TODO: remove branches
- branches: ["*"]
+on: push
jobs:
test-rust:
diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml
index b118179fc..a21b8531e 100644
--- a/.github/workflows/unittests.yml
+++ b/.github/workflows/unittests.yml
@@ -1,4 +1,4 @@
-name: tests
+name: Python unit tests
on: push