From a1ec071ce16fc9e9d3e26b5f1b70273229c4ba95 Mon Sep 17 00:00:00 2001 From: Artem Veremey Date: Thu, 11 Mar 2021 01:32:54 -0800 Subject: [PATCH 1/4] Add Windows and Conda CI. Seriously. --- .github/workflows/test.yml | 71 ++++++++++++++++++++++++++++++++++++-- conda-environment.yaml | 7 ++++ 2 files changed, 76 insertions(+), 2 deletions(-) create mode 100755 conda-environment.yaml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 19f6b216a85..b76e1d8e32e 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 }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest", "windows-latest"] + 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..ce79bbfe32c --- /dev/null +++ b/conda-environment.yaml @@ -0,0 +1,7 @@ +channels: + - conda-forge +dependencies: + - python + - poetry + - jupyter + - pytest \ No newline at end of file From 14a1ed2e31a629f052437c967820bcb7c7862658 Mon Sep 17 00:00:00 2001 From: Artem Veremey Date: Thu, 11 Mar 2021 01:34:12 -0800 Subject: [PATCH 2/4] Add empty line --- conda-environment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda-environment.yaml b/conda-environment.yaml index ce79bbfe32c..b585cf560ec 100755 --- a/conda-environment.yaml +++ b/conda-environment.yaml @@ -4,4 +4,4 @@ dependencies: - python - poetry - jupyter - - pytest \ No newline at end of file + - pytest From f9b8c4dcaf5a5361b8e11246ed3aa2967a66058d Mon Sep 17 00:00:00 2001 From: Artem Veremey Date: Thu, 11 Mar 2021 01:49:49 -0800 Subject: [PATCH 3/4] Fix formatting --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b76e1d8e32e..5bad3e85d79 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -124,8 +124,8 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-latest", "windows-latest"] - python-version: ["3.8"] + os: [ubuntu-latest, windows-latest] + python-version: ['3.8'] dependencies: [""] include: - os: ubuntu From 823ecc840041bc7f82e4a4d31e39a26b2b286c7f Mon Sep 17 00:00:00 2001 From: Artem Veremey Date: Thu, 11 Mar 2021 01:55:56 -0800 Subject: [PATCH 4/4] The elusive coma version build --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5bad3e85d79..860ceb1ca81 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -120,13 +120,13 @@ jobs: tests-conda: name: Conda (${{ matrix.python-version }}, ${{ matrix.os }}) needs: test - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.os }}-latest strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest] + os: ['ubuntu', 'windows'] python-version: ['3.8'] - dependencies: [""] + dependencies: [''] include: - os: ubuntu python: 3.8