environment update #108
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################ | |
# Copyright (c) 2021 ContinualAI. # | |
# Copyrights licensed under the MIT License. # | |
# See the accompanying LICENSE file for terms. # | |
# # | |
# Date: 15-07-2021 # | |
# Author(s): Gabriele Graffieti # | |
# E-mail: [email protected] # | |
# Website: avalanche.continualai.org # | |
################################################################################ | |
name: environment update | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/environment-update.yml' | |
- 'requirements.txt' | |
- 'setup.py' | |
- 'extra_dependencies.txt' | |
schedule: | |
- cron: '0 0 * * 0' # midnight of every Sunday | |
jobs: | |
environment-creation: | |
if: github.repository == 'ContinualAI/avalanche' | |
name: new environment creation | |
runs-on: ubuntu-latest | |
container: | |
image: condaforge/mambaforge:latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: install opencv and quadprog dependency libs | |
env: | |
DEBIAN_FRONTEND: "noninteractive" | |
TZ: "Etc/UTC" | |
run: | | |
apt-get update && | |
apt-get install ffmpeg libsm6 libxext6 build-essential -y | |
- name: install conda environment | |
run: | | |
mamba create -n avalanche-env -y -v python=${{ matrix.python-version }} -c conda-forge && | |
conda run -n avalanche-env --no-capture-output pip install -r requirements.txt | |
- name: python unit test | |
id: unittest | |
env: | |
FAST_TEST: "True" | |
USE_GPU: "False" | |
shell: bash -l -c "conda run -n avalanche-env --no-capture-output bash {0}" | |
run: | | |
python -m unittest discover tests && | |
echo "Running checkpointing tests..." && | |
bash ./tests/checkpointing/test_checkpointing.sh && | |
echo "Running distributed training tests..." && | |
cd tests && | |
PYTHONPATH=.. python run_dist_tests.py && | |
cd .. | |
- name: checkout avalanche-docker repo | |
if: always() | |
uses: actions/checkout@v3 | |
with: | |
repository: 'ContinualAI/avalanche-docker' | |
ref: master | |
path: 'avalanche-docker' | |
token: ${{ secrets.BOT_TOKEN }} | |
- name: test success | |
if: success() | |
shell: bash -l -c "conda run -n avalanche-env --no-capture-output bash {0}" | |
run: | | |
rm -f avalanche-docker/${{ matrix.python-version }}/environment-${{ matrix.python-version }}.yml && | |
conda env export > $"avalanche-docker/"${{ matrix.python-version }}"/environment-"${{ matrix.python-version }}".yml" && | |
cd avalanche-docker && | |
git config --local user.email ${{ secrets.BOT_EMAIL }} && | |
git config --local user.name ${{ secrets.BOT_NAME }} && | |
git pull && | |
git add . && | |
git commit -m $"Update environment with python "${{ matrix.python-version }} -a || true && | |
git pull | |
- name: Push changes to avalanche-docker | |
if: success() | |
continue-on-error: true | |
uses: ad-m/github-push-action@master | |
with: | |
repository: ContinualAI/avalanche-docker | |
branch: master | |
directory: avalanche-docker | |
github_token: ${{ secrets.BOT_TOKEN }} |