Skip to content

Commit

Permalink
Update github actions to also test rust under spfs
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Bottriell <ryan@bottriell.ca>
  • Loading branch information
rydrman committed Apr 2, 2022
1 parent 9fba4f2 commit 08382d3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 52 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/rust.yml

This file was deleted.

25 changes: 19 additions & 6 deletions .github/workflows/python.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python
name: Lint & Test

on:
pull_request:
Expand All @@ -10,16 +10,28 @@ env:
CARGO_TERM_COLOR: always

jobs:
lint:
lint-python:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- run: sudo pip3 install pipenv
- run: pipenv sync --dev
- name: Lint Formatting with Black
run: pipenv run -- black --check .
- name: Lint Typing with MyPy
run: pipenv run -- mypy spk
- name: Lint Python Code
run: make lint-python
lint-rust:
runs-on: ubuntu-latest
env:
SPFS_PULL_USERNAME: ${{ secrets.SPFS_PULL_USERNAME }}
SPFS_PULL_PASSWORD: ${{ secrets.SPFS_PULL_PASSWORD }}
steps:
- uses: actions/checkout@v2
- name: Check Rust Formatting
run: cargo fmt -- --check
- run: sudo apt-get install -y libcap-dev
- name: Patch spfs Pull Auth
run: sed -i "s|github.com|$SPFS_PULL_USERNAME:$SPFS_PULL_PASSWORD@github.com|" Cargo.toml
- name: Lint Rust Code
run: make lint-rust
test:
runs-on: ubuntu-18.04
steps:
Expand Down Expand Up @@ -48,6 +60,7 @@ jobs:
-e SPFS_PULL_USERNAME
-e SPFS_PULL_PASSWORD
-e HOME=/root
-e CI
--rm
--privileged
-v $PWD:/source
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ devel:
.PHONY: test test-python test-rust
test: test-rust test-python
test-rust:
# other tooling (rust-analyzer) can create
# unhappy builds of pyo3 which cause the build of
# the tests to fail
cargo clean -p pyo3 && cargo test --no-default-features
spfs run - -- cargo test --no-default-features
test-python:
mkdir -p /tmp/spfs-runtimes
SPFS_STORAGE_RUNTIMES="/tmp/spfs-runtimes" \
Expand Down
3 changes: 3 additions & 0 deletions examples/_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ def test_example(stage: str, spec_file: str) -> None:
except FileNotFoundError:
pytest.skip("examples depend on external packages")

if "CI" in os.environ:
pytest.skip("examples depend on external packages, and do not run in CI")

subprocess.check_call(
[
os.path.dirname(sys.executable) + "/spk",
Expand Down

0 comments on commit 08382d3

Please sign in to comment.