-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: run unit-tests with composite action
- Loading branch information
Showing
2 changed files
with
93 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: "Unit tests" | ||
|
||
inputs: | ||
test-name: | ||
description: 'Unit test name' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Clean up disk space | ||
run: | | ||
df -h | ||
sudo rm -rf \ | ||
/usr/lib/mono \ | ||
/usr/local/julia* \ | ||
/usr/local/lib/android \ | ||
/usr/local/lib/node_modules \ | ||
/usr/local/share/chromium \ | ||
/usr/local/share/powershell \ | ||
/usr/share/dotnet \ | ||
/usr/share/swift \ | ||
/opt/google/chrome \ | ||
/opt/microsoft/msedge \ | ||
/opt/microsoft/powershell \ | ||
"$AGENT_TOOLSDIRECTORY" | ||
df -h / | ||
shell: bash | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
path: repo | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
- name: Install test prerequisites | ||
run: sudo apt-get update && sudo apt-get -y install libgl1-mesa-glx | ||
shell: bash | ||
- name: Trigger unit tests | ||
run: | | ||
echo "Attempting to run unit tests" | ||
cd repo/src | ||
sudo tox -e {{ inputs.test-name }} | ||
exit_code=$? | ||
echo "Unit tests finished" | ||
exit $exit_code | ||
shell: bash | ||
- name: Clean up virtualenv | ||
run: | | ||
sudo rm -rf .tox/{{ inputs.test-name }} | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters