diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 80a35c81..06fa79ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,18 +7,23 @@ on: pull_request: branches: - main - + +permissions: + contents: write + jobs: build: runs-on: ubuntu-latest strategy: matrix: python-version: ["3.9", "3.10", "3.11"] + fail-fast: false steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2.2.2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -26,10 +31,12 @@ jobs: run: make setup - name: Set up cache - uses: actions/cache@v2.1.6 + uses: actions/cache@v3 with: path: .venv key: venv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }} + restore-keys: | + venv-${{ matrix.python-version }}- - name: Install dependencies run: | @@ -51,3 +58,37 @@ jobs: poetry install --with tests make test + update-badge: + needs: build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" # Use latest version for badge update + + - name: Install poetry + run: make setup + + - name: Install dependencies + run: | + poetry config virtualenvs.in-project true + poetry install --with tests + + - name: Generate coverage badge + run: make test + + - name: Commit and push coverage badge + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git pull --rebase origin main + git add assets/images/coverage.svg + git commit -m "Update coverage badge" || echo "No changes to commit" + git push || git pull --rebase origin main && git push diff --git a/diagram.svg b/diagram.svg deleted file mode 100644 index bf43c409..00000000 --- a/diagram.svg +++ /dev/null @@ -1 +0,0 @@ -teststestsprojectsprojectslighterlighterdockerdockerintegrationintegrationcifar10cifar10utilsutilscallbackscallbacksmodelsmodelswriterwriterunit/test_du...unit/test_du...unit/test_du...system.pysystem.pysystem.pycontribcontribcontribpoetry.lockpoetry.lockpoetry.lock.safety-poli....safety-poli....safety-poli...pyproject.tomlpyproject.tomlpyproject.tomlCODE_OF_CON...CODE_OF_CON...CODE_OF_CON...MakefileMakefileMakefile.gitignore.gitignore.gitignoreexperiments/...experiments/...experiments/...model.pymodel.pymodel.pyfreezer.pyfreezer.pyfreezer.pycollate.pycollate.pycollate.pyrunner.pyrunner.pyrunner.pymisc.pymisc.pymisc.pydynamic_...dynamic_...dynamic_...logger.pylogger.pylogger.pyutils.pyutils.pyutils.pybase.pybase.pybase.pyfile.pyfile.pyfile.pytable.pytable.pytable.py.gitignore.md.py.svg.toml.yaml.ymleach dot sized by file size \ No newline at end of file