-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #675 from sahib/github-ci
- Migrate from TravisCI to GH Actions. Use tmpfs to speedup the run. - Use tmpfs for test files. - Initial support for pytest. - Cleanup test folder between runs, as some tests fail when the folder is in an unexpected state.
- Loading branch information
Showing
6 changed files
with
54 additions
and
24 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,40 @@ | ||
name: Build and test rmlint (master) | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
RM_TS_DIR: "/tmp/rmlint-unit-testdir" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: "Prepare build environment" | ||
run: | | ||
sudo apt update | ||
sudo apt install -y --no-install-recommends \ | ||
scons python3-sphinx gettext python3-setuptools \ | ||
libblkid-dev libelf-dev libglib2.0-dev libjson-glib-dev \ | ||
clang python3-pip python3-cffi python3-dev libffi-dev | ||
pip3 install -r tests/requirements.txt | ||
- name: "Build" | ||
# Todo: eventually run tests with valgrind (RM_TS_USE_VALGRIND) | ||
# Todo enable slow tests in pytest | ||
run: | | ||
scons config | ||
scons VERBOSE=1 DEBUG=1 O=release | ||
- name: "Prepare test environment" | ||
# The test suite is seriously disk-intensive. Given that linux | ||
# instances hosted in GitHub have 16G of RAM available we will | ||
# use it to speed up the run. | ||
run: | | ||
sudo mkdir "${RM_TS_DIR}" | ||
sudo mount -o size=12G,nr_inodes=0 -t tmpfs tmpfs "${RM_TS_DIR}" | ||
- name: "Test" | ||
run: | | ||
RM_TS_PRINT_CMD=1 RM_TS_PEDANTIC=0 python -m pytest -s -v |
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 |
---|---|---|
|
@@ -31,3 +31,5 @@ gui/app/resources/app.gresource | |
rmlint.*.sh | ||
rmlint.*.json | ||
|
||
# JetBrains' IDE | ||
.idea |
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
import pytest | ||
from tests.utils import cleanup_testdir, create_testdir | ||
|
||
@pytest.fixture(autouse=True) | ||
def with_cleanup_between_runs(): | ||
cleanup_testdir() | ||
create_testdir() |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
nose==1.3.7 | ||
pytest==8.3.4 | ||
parameterized==0.6.1 | ||
xattr==0.9.6 | ||
psutil==5.6.6 |
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