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

[#45] Implement the das-node tests pipeline #46

Merged
merged 9 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ on:
required: true

jobs:
code-quality:
uses: ./.github/workflows/run-tests.yml
secrets: inherit

tag:
needs: code-quality
uses: singnet/das/.github/workflows/run-semver.yml@master
with:
version: ${{ github.event.inputs.version }}
Expand All @@ -32,7 +37,6 @@ jobs:

- name: Update version
run: sed -i "s/version=.*/version='${{ github.event.inputs.version }}',/" pyproject.toml


- name: Build (Docker Image)
run: ./scripts/docker_image_build.sh
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
name: Run Unit & Integration tests

on:
workflow_call:

pull_request:
branches:
- master

workflow_dispatch:

jobs:
build-wheel:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build Bazel
run: make bazel-build

- name: Build Wheel
run: make wheel

- name: Upload das-node-wheel artifact
uses: actions/upload-artifact@v4
with:
name: das-node-wheel
path: dist/*

unit-tests-python:
runs-on: ubuntu-22.04
needs: build-wheel
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ~3.10
cache: "pip"

- name: Download das-node-wheel artifact
uses: actions/download-artifact@v4
with:
name: das-node-wheel
path: dist

- name: Installing das-node-wheel
run: pip install $(find . -name *.whl -type f | head -n 1)

- name: Execute Python Unit Test
run: make test-python

unit-tests-cpp:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build Bazel
run: make bazel-build

- name: Execute C++ Unit Test
run: docker run --rm -i das-node-builder make test-cpp
2 changes: 1 addition & 1 deletion scripts/_build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ find ${TMP_DEST_DIR} -type f -name "*.whl" \
[ $? -ne 0 ] && exit 1

# Change ownership
chown -R ${_USER}:${_GROUP} ${DEST_DIR}
chown -R ${_USER}:${_USER} ${DEST_DIR}
[ $? -ne 0 ] && exit 1

# Clean up
Expand Down
4 changes: 4 additions & 0 deletions scripts/bazel_test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/bash

cd src

bazel test --noenable_bzlmod --cache_test_results=no //...

cd -