diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 984ba94..a4cacb8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -20,6 +20,10 @@ jobs: conda-build: name: Conda Build runs-on: ubuntu-latest + env: + NAME: test-${{ github.event.repository.name }} + outputs: + artifact-name: ${{ env.NAME }} steps: - uses: actions/checkout@v4 @@ -35,32 +39,54 @@ jobs: - name: Run conda build shell: bash -el {0} - run: conda build . --no-anaconda-upload + id: build + run: | + echo "path=$(conda build . --no-anaconda-upload --output-folder=./build --output)" >> $GITHUB_OUTPUT + + - uses: actions/upload-artifact@v4 + with: + name: ${{ env.NAME }} + if-no-files-found: error + path: ${{ steps.build.outputs.path }} tests: name: Tests runs-on: ubuntu-latest + needs: conda-build # Run the job for different versions of python strategy: matrix: python-version: ["3.10", "3.11", "3.12"] + env: + ARTIFACT_LOCATION: ./conda-local + # Steps represent a sequence of tasks that will be executed as part of the job steps: - name: Checkout code uses: actions/checkout@v4.1.7 + - uses: actions/download-artifact@v4 + with: + name: ${{ needs.conda-build.outputs.artifact-name }} + path: ${{ env.ARTIFACT_LOCATION }} + - name: Setup conda environment uses: conda-incubator/setup-miniconda@v3 with: miniconda-version: "latest" python-version: ${{ matrix.python-version }} - - name: Install source + - name: DEBUG - where are things + run: ls ${{ env.ARTIFACT_LOCATION }} + + - name: Install conda package shell: bash -l {0} - run: python -m pip install -e . + run: | + conda index ${{ env.ARTIFACT_LOCATION }} + conda install -c file:///${{ env.ARTIFACT_LOCATION }} um2nc - name: List installed packages shell: bash -l {0} diff --git a/conda/environment.yml b/conda/environment.yml index 0667bea..df43c50 100644 --- a/conda/environment.yml +++ b/conda/environment.yml @@ -11,3 +11,4 @@ dependencies: - conda-build - conda-verify - versioneer + - pylint