From faadfa8736e5a06ed41e77343664e28c2622f9a5 Mon Sep 17 00:00:00 2001 From: "r.jaepel" Date: Mon, 23 Oct 2023 13:26:10 +0200 Subject: [PATCH] Add python initialization and dependency install to CI --- .github/workflows/push_ci.yml | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/push_ci.yml b/.github/workflows/push_ci.yml index d6dfdad..f59181b 100644 --- a/.github/workflows/push_ci.yml +++ b/.github/workflows/push_ci.yml @@ -1,4 +1,8 @@ -on: push +on: + push: + branches: + - dev + - test-ci jobs: build: runs-on: ubuntu-latest @@ -7,6 +11,26 @@ jobs: - run: | git config user.name github-actions git config user.email github-actions@github.com - python ./workshop_git_tools/process_repo.py - git commit -m "generated" - git push + - name: Cache conda + uses: actions/cache@v3 + env: + # Increase this value to reset cache if etc/example-environment.yml has not changed + CACHE_NUMBER: 2 + with: + path: ~/conda_pkgs_dir + key: + ${{ matrix.os }}-python_${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('etc/example-environment.yml') }} + - uses: conda-incubator/setup-miniconda@v2 + with: + python-version: ${{ matrix.python-version }} + miniforge-variant: Mambaforge + use-mamba: true + auto-update-conda: true + channels: conda-forge, + - name: Install dependencies + run: | + mamba env create -f environment.yml + mamba activate cadet_workshop + - name: Generate teaching and solution branches + run: | + python ./workshop_git_tools/process_repo.py --commit --push