Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow update #78

Merged
merged 9 commits into from
Jul 1, 2024
6 changes: 3 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ jobs:
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
-
name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
push: true
tags: |
Expand Down
38 changes: 30 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
name: Run deenurp tests on deenurp image

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: push

jobs:
build:
dev_image:
environment: docker_build
runs-on: ubuntu-latest
outputs:
sha_short: ${{ env.sha_short }}
steps:
-
name: Set env
run: echo "sha_short=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/fhcrc/deenurp:${{ env.sha_short }}
test:
needs: [dev_image]
runs-on: ubuntu-latest
container:
image: ghcr.io/fhcrc/deenurp:latest
image: ghcr.io/fhcrc/deenurp:${{ needs.dev_image.outputs.sha_short }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: |
python3 -m deenurp.test
tests/run.sh
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ COPY deenurp.py setup.py requirements.txt /usr/local/share/deenurp/
RUN cd /usr/local/share/deenurp/ && \
PYTHON=/usr/local/bin/python3 \
DEENURP=/usr/local/share/deenurp/ \
bin/bootstrap.sh /usr/local/
bin/bootstrap.sh /usr/local/ \
pip install --upgrade --requirement requirements.txt

# clean up sources apt packages
RUN rm -rf /var/lib/apt/lists/* && \
Expand Down
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
f'|| rm -f {version_file}.tmp'),
shell=True, stderr=open(os.devnull, "w"))

# import must follow 'git describe' command above to update version
from deenurp import __version__
try:
with open(version_file) as f:
version = f.read().strip().lstrip('v').replace(
'-', '+', 1).replace('-', '.')
except Exception as e:
version = ''


class CheckVersion(Command):
Expand Down Expand Up @@ -77,7 +81,7 @@ def run(self):

setup(
name='deenurp',
version=__version__,
version=version,
package_data={'deenurp': ['data/*', 'test/data/*']},
entry_points={
'console_scripts': {'deenurp = deenurp:main'}},
Expand Down