From 020a9288574deeb1391f44c92d3a8dbe98e70042 Mon Sep 17 00:00:00 2001 From: "Moritz E. Beber" Date: Thu, 19 Oct 2023 14:37:07 +0200 Subject: [PATCH] chore: update actions --- .github/workflows/biosimulators_dispatch.yml | 5 +- .github/workflows/lint.yml | 52 ++++---- .github/workflows/main.yml | 123 +++++++++---------- .github/workflows/safety.yml | 36 +++--- 4 files changed, 108 insertions(+), 108 deletions(-) diff --git a/.github/workflows/biosimulators_dispatch.yml b/.github/workflows/biosimulators_dispatch.yml index b4f28ff35..654d0bd03 100644 --- a/.github/workflows/biosimulators_dispatch.yml +++ b/.github/workflows/biosimulators_dispatch.yml @@ -9,9 +9,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Get tag - id: tag - run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}" - name: Dispatch new release version to BioSimulators uses: benc-uk/workflow-dispatch@v1 with: @@ -19,4 +16,4 @@ jobs: repo: biosimulators/Biosimulators_COBRApy ref: dev token: ${{ secrets.BIOSIM_DISPATCH_TOKEN }} - inputs: '{ "simulatorVersion": "${{ steps.tag.outputs.version }}", "simulatorVersionLatest": "true" }' + inputs: '{ "simulatorVersion": "${{ github.ref_name }}", "simulatorVersionLatest": "true" }' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 113762410..f24b68d7a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,15 +3,15 @@ name: Lint on: push: branches: - - stable - - devel + - stable + - devel tags: - - '[0-9]+.[0-9]+.[0-9]+' - - '[0-9]+.[0-9]+.[0-9]+a[0-9]+' + - "[0-9]+.[0-9]+.[0-9]+" + - "[0-9]+.[0-9]+.[0-9]+a[0-9]+" pull_request: branches: - - stable - - devel + - stable + - devel jobs: lint: @@ -20,25 +20,27 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: ['3.10'] + python-version: ["3.11"] timeout-minutes: 60 steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools wheel - python -m pip install tox tox-gh-actions - - name: isort - run: - tox -e isort - - name: black - run: - tox -e black - - name: flake8 - run: - tox -e flake8 + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + python -m pip install tox tox-gh-actions + + - name: isort + run: tox -e isort + + - name: black + run: tox -e black + + - name: flake8 + run: tox -e flake8 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6f97e4849..b43a978e7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,15 +3,15 @@ name: CI-CD on: push: branches: - - stable - - devel + - stable + - devel tags: - - '[0-9]+.[0-9]+.[0-9]+' - - '[0-9]+.[0-9]+.[0-9]+a[0-9]+' + - "[0-9]+.[0-9]+.[0-9]+" + - "[0-9]+.[0-9]+.[0-9]+a[0-9]+" pull_request: branches: - - stable - - devel + - stable + - devel jobs: test: @@ -20,71 +20,70 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ["3.8", "3.11"] timeout-minutes: 360 steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools wheel - python -m pip install tox tox-gh-actions - - name: Test with tox - run: - tox -- --benchmark-skip - timeout-minutes: 60 - - name: Report coverage - shell: bash - run: bash <(curl -s https://codecov.io/bash) + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + python -m pip install tox tox-gh-actions + - name: Test with tox + run: tox -- --benchmark-skip + timeout-minutes: 60 + - name: Report coverage + shell: bash + run: bash <(curl -s https://codecov.io/bash) release: needs: test - if: startsWith(github.ref, 'refs/tags') + if: github.ref_type == 'tag' runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest] - python-version: [3.8] + python-version: ["3.11"] + permissions: + contents: write steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Get tag - id: tag - run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}" - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools wheel - python -m pip install build twine - - name: Build package - run: python -m build - - name: Publish to PyPI - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: - twine upload --skip-existing --non-interactive dist/* - - name: Create GitHub release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - body_path: "release-notes/${{ steps.tag.outputs.version }}.md" - draft: false - prerelease: false - - name: Publish to website - run: ./scripts/deploy_website.sh - shell: bash - env: - TAG: ${{ steps.tag.outputs.version }} - WORKSPACE: ${{ github.workspace }} - WEBSITE_DEPLOY_TOKEN: ${{ secrets.WEBSITE_DEPLOY_TOKEN }} + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + python -m pip install build twine + + - name: Build package + run: python -m build + + - name: Publish to PyPI + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: twine upload --skip-existing --non-interactive dist/* + + - name: GH release + uses: softprops/action-gh-release@v1 + with: + body_path: "release-notes/${{ github.ref_name }}.md" + draft: false + prerelease: false + + - name: Publish to website + run: ./scripts/deploy_website.sh + shell: bash + env: + TAG: ${{ github.ref_name }} + WORKSPACE: ${{ github.workspace }} + WEBSITE_DEPLOY_TOKEN: ${{ secrets.WEBSITE_DEPLOY_TOKEN }} diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml index e1135526e..2ee91668e 100644 --- a/.github/workflows/safety.yml +++ b/.github/workflows/safety.yml @@ -3,11 +3,11 @@ name: Safety on: push: branches: - - stable - - devel + - stable + - devel tags: - - '[0-9]+.[0-9]+.[0-9]+' - - '[0-9]+.[0-9]+.[0-9]+a[0-9]+' + - "[0-9]+.[0-9]+.[0-9]+" + - "[0-9]+.[0-9]+.[0-9]+a[0-9]+" jobs: safety: @@ -16,19 +16,21 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ["3.8", "3.9", "3.10", "3.11"] timeout-minutes: 120 steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools wheel - python -m pip install tox tox-gh-actions - - name: safety - run: - tox -e safety + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + python -m pip install tox tox-gh-actions + + - name: safety + run: tox -e safety