Skip to content

Commit

Permalink
Merge pull request #37 from Flegyas/feature/cicd-cuda
Browse files Browse the repository at this point in the history
Modify the publish.yml CD to be lighter
  • Loading branch information
lucmos authored May 15, 2024
2 parents 2758216 + fd6a95c commit f0cc15b
Showing 1 changed file with 0 additions and 107 deletions.
107 changes: 0 additions & 107 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ on:
types:
- created

env:
CACHE_NUMBER: 0 # increase to reset cache manually
CONDA_ENV_FILE: './env.yaml'
CONDA_ENV_NAME: 'latentis'


jobs:
build:
strategy:
Expand All @@ -31,16 +25,6 @@ jobs:
id-token: write

steps:
- name: Parametrize conda env name
run: echo "PY_CONDA_ENV_NAME=${{ env.CONDA_ENV_NAME }}-${{ matrix.python-version }}" >> $GITHUB_ENV
- name: echo conda env name
run: echo ${{ env.PY_CONDA_ENV_NAME }}

- name: Parametrize conda prefix
run: echo "PY_PREFIX=${{ matrix.prefix }}${{ env.PY_CONDA_ENV_NAME }}" >> $GITHUB_ENV
- name: echo conda prefix
run: echo ${{ env.PY_PREFIX }}

# extract the first two digits from the release note
- name: Set release notes tag
run: |
Expand All @@ -55,97 +39,6 @@ jobs:
with:
fetch-depth: 0

# Remove the python version pin from the env.yml which could be inconsistent
- name: Remove explicit python version from the environment
shell: bash -l {0}
run: |
sed -Ei '/^\s*-?\s*python\s*([#=].*)?$/d' ${{ env.CONDA_ENV_FILE }}
cat ${{ env.CONDA_ENV_FILE }}
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: ${{ env.PY_CONDA_ENV_NAME }}
python-version: ${{ matrix.python-version }}
use-mamba: true

- uses: actions/cache@v2
name: Conda cache
with:
path: ${{ env.PY_PREFIX }}
key: ${{ matrix.label }}-conda-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ env.PY_CONDA_ENV_NAME }}-${{ hashFiles(env.CONDA_ENV_FILE) }}-${{hashFiles('./setup.cfg') }}
id: conda_cache

- uses: actions/cache@v2
name: Pip cache
with:
path: ~/.cache/pip
key: ${{ matrix.label }}-pip-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ env.PY_CONDA_ENV_NAME }}-${{ hashFiles(env.CONDA_ENV_FILE) }}-${{hashFiles('./setup.cfg') }}

- uses: actions/cache@v2
name: Pre-commit cache
with:
path: ~/.cache/pre-commit
key: ${{ matrix.label }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ env.PY_CONDA_ENV_NAME }}-${{ hashFiles(env.CONDA_ENV_FILE) }}-${{hashFiles('./setup.cfg') }}

# Ensure the hack for the python version worked
- name: Ensure we have the right Python
shell: bash -l {0}
run: |
echo "Installed Python: $(python --version)"
echo "Expected: ${{ matrix.python-version }}"
python --version | grep "Python ${{ matrix.python-version }}"
# https://stackoverflow.com/questions/70520120/attributeerror-module-setuptools-distutils-has-no-attribute-version
# https://github.com/pytorch/pytorch/pull/69904
# - name: Downgrade setuptools due to a but in PyTorch 1.10.1
# shell: bash -l {0}
# run: |
# pip install setuptools==59.5.0 --upgrade

- name: Update conda environment
run: mamba env update -n ${{ env.PY_CONDA_ENV_NAME }} -f ${{ env.CONDA_ENV_FILE }}
if: steps.conda_cache.outputs.cache-hit != 'true'

# Update pip env whether or not there was a conda cache hit
- name: Update pip environment
shell: bash -l {0}
run: pip install -e ".[dev]"
if: steps.conda_cache.outputs.cache-hit == 'true'

- run: pip3 list
shell: bash -l {0}
- run: mamba info
- run: mamba list

# Ensure the hack for the python version worked
- name: Ensure we have the right Python
shell: bash -l {0}
run: |
echo "Installed Python: $(python --version)"
echo "Expected: ${{ matrix.python-version }}"
python --version | grep "Python ${{ matrix.python-version }}"
- name: Run pre-commits
shell: bash -l {0}
run: |
pre-commit install
pre-commit run -v --all-files --show-diff-on-failure
# - name: Test with pytest
# shell: bash -l {0}
# run: |
# pytest -v

# - name: Build docs website
# shell: bash -l {0}
# run: |
# git config user.name ci-bot
# git config user.email [email protected]
# mike deploy --rebase --push --update-aliases ${RELEASE_TAG_VERSION} latest

- name: Check working directory status
run: git status

Expand Down

0 comments on commit f0cc15b

Please sign in to comment.