From 36516624485489aa1116e1fc087998cf12325c64 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Mon, 20 Dec 2021 11:27:58 -0500 Subject: [PATCH 1/3] add test workflow --- .github/workflows/tests.yml | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..d07a113 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,55 @@ +name: Tests + +on: [push, pull_request] + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["windows-latest", "ubuntu-latest", "macos-latest"] + python-version: ["3.7", "3.8", "3.9"] + + env: + PYTHON_VERSION: ${{ matrix.python-version }} + PARALLEL: "true" + COVERAGE: "true" + + steps: + - name: Check out repository code + uses: actions/checkout@v2 + + # Setup Python (faster than using Python container) + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + + - name: Install poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v2 + with: + path: .venv + key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + + - name: Install dependencies + if: steps.cache-poetry.outputs.cache-hit != 'true' + run: | + poetry install --no-interaction --no-root + + - name: Install library + run: | + poetry install --no-interaction + + - name: Run tests + run: | + source .venv/bin/activate + pytest tests/ \ No newline at end of file From d5617b1f6203d19a42fddf1a58864a4e7582277e Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Mon, 20 Dec 2021 12:46:49 -0500 Subject: [PATCH 2/3] propagate dynamic python version into env setup --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d07a113..86ea0df 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: "3.x" + python-version: ${{ matrix.python-version }} - name: Install poetry uses: snok/install-poetry@v1 From dc0bb93e91f3b05dd357b27cc56e1f2fb6c4b140 Mon Sep 17 00:00:00 2001 From: Davis Vann Bennett Date: Mon, 20 Dec 2021 13:21:22 -0500 Subject: [PATCH 3/3] try setting the shell to dodge a windows platform issue --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 86ea0df..a8fc679 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -50,6 +50,7 @@ jobs: poetry install --no-interaction - name: Run tests + shell: bash -l {0} run: | source .venv/bin/activate pytest tests/ \ No newline at end of file