diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 19f6b216a85..860ceb1ca81 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,7 +69,8 @@ jobs: run: | source $VENV pytest tests/ - tests: + tests-python: + name: Python (${{ matrix.python-version }}, ${{ matrix.os }}) needs: test runs-on: ${{ matrix.os }} strategy: @@ -80,7 +81,6 @@ jobs: exclude: - os: ubuntu-latest python-version: '3.8' - name: ${{ matrix.os}} - Python ${{ matrix.python-version }} steps: - name: Checkout Code uses: actions/checkout@v2 @@ -117,3 +117,70 @@ jobs: run: | source $VENV pytest tests/ + tests-conda: + name: Conda (${{ matrix.python-version }}, ${{ matrix.os }}) + needs: test + runs-on: ${{ matrix.os }}-latest + strategy: + fail-fast: false + matrix: + os: ['ubuntu', 'windows'] + python-version: ['3.8'] + dependencies: [''] + include: + - os: ubuntu + python: 3.8 + - os: windows + python: 3.8 + env: + OS: ${{ matrix.os }} + PYTHON: ${{ matrix.python }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + # Need to fetch more than the last commit so that setuptools-scm can + # create the correct version string. If the number of commits since + # the last release is greater than this, the version still be wrong. + # Increase if necessary. + fetch-depth: 100 + # The GitHub token is preserved by default but this job doesn't need + # to be able to push to GitHub. + persist-credentials: false + + - name: Setup caching for conda packages + uses: actions/cache@v2 + with: + path: ~/conda_pkgs_dir + key: conda-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('requirements*.txt') }} + + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + python-version: ${{ matrix.python }} + miniconda-version: "latest" + auto-update-conda: true + channels: conda-forge + show-channel-urls: true + environment-file: conda-environment.yaml + activate-environment: testing + # Needed for caching + use-only-tar-bz2: true + + - name: Update Temp permissions on windows + if: runner.os == 'Windows' + shell: cmd /C CALL {0} + run: >- + c:\windows\system32\icacls C:\Users\runneradmin\AppData\Local\Temp /grant "everyone":F /t + - name: Install dependencies (Bash) + shell: bash -l {0} + run: | + conda info + pip install --user --requirement requirements.txt + - name: List installed packages (Bash) + shell: bash -l {0} + run: conda list + + - name: Run tests (Bash) + shell: bash -l {0} + run: pytest tests/ diff --git a/conda-environment.yaml b/conda-environment.yaml new file mode 100755 index 00000000000..b585cf560ec --- /dev/null +++ b/conda-environment.yaml @@ -0,0 +1,7 @@ +channels: + - conda-forge +dependencies: + - python + - poetry + - jupyter + - pytest