From ffbcbca7ea3ddfc3db140dbc790fa9359a77d8c4 Mon Sep 17 00:00:00 2001 From: krzywon Date: Tue, 9 Aug 2022 14:31:46 -0400 Subject: [PATCH] Yaml file to ensure egg is built properly and all tests pass --- .github/workflows/test.yml | 66 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..3cb1e96 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,66 @@ +name: Tests + +on: + [push, pull_request] + +defaults: + run: + shell: bash + +jobs: + unit-test: + + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + python-version: [3.7, 3.8, 3.9] + fail-fast: false + + steps: + + - name: Obtain SasData source from git + uses: actions/checkout@v1 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + + ### Caching of pip downloads and local wheel builds + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - name: Obtain pip cache (Linux) + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/test.yml') }} + restore-keys: | + ${{ runner.os }}-pip-${{ matrix.python-version }}- + ${{ runner.os }}-pip- + + ### Installation of build-dependencies + + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + python -m pip install wheel setuptools + python -m pip install numpy lxml h5py + + ### Actual building/testing of sasdata + + - name: Build sasdata + run: | + # BUILD SASDATA + python setup.py clean + python setup.py build + python -m pip install . + + - name: Test with pytest + env: + PYOPENCL_COMPILER_OUTPUT: 1 + run: | + python -m pytest -v -s test