Skip to content

Commit

Permalink
Merge pull request #10 from odissei-data/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
FjodorvRijsselberg authored Jul 3, 2023
2 parents ebe1f3f + ba8244b commit fb48f71
Show file tree
Hide file tree
Showing 14 changed files with 564 additions and 347 deletions.
66 changes: 0 additions & 66 deletions .github/workflows/docker-image.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/image-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Docker Image CI

on:
push:
tags:
- '*'

jobs:
push:
name: Push to registry.
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set python version
uses: actions/setup-python@v4
with:
python-version: '3.9.14'
- name: Perform gruesome hack
run: |
cp -r pyproject.toml src/stub.toml
- name: Get version and tag image
run: |
pip install tomli
cd src/
echo "version=`python version.py`" >> $GITHUB_ENV
- name: Login to registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_PASSWORD }}
- name: Push to dockerhub
run: |
docker build . --file Dockerfile --tag fjodorvr/metadata-refiner:${{ env.version }}
docker push fjodorvr/metadata-refiner:${{ env.version }}
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Pytest action

on:
push:
branches: [ "main" ]
tags:
- '*'
pull_request:
branches: [ "main" ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9.14"]
name: Run tests
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set python version
uses: actions/setup-python@v4
with:
python-version: '3.9.14'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install poetry
poetry config virtualenvs.create false
poetry install
- name: Perform gruesome hack
run: |
cp -r pyproject.toml src/stub.toml
cp -r pyproject.toml src/tests/stub.toml
- name: Run Pytest
working-directory: src/
run: python -m pytest

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ startbg: ## Start project running in detached mode - background.
stop: ## Stop the running project.
@docker-compose stop
test: ## Run unit tests
@docker exec -it ${CONTAINER_NAME} pytest
@docker exec -it ${CONTAINER_NAME} python -m pytest
copy-poetry-files: ## Copies poetry files inside container
@docker cp ./pyproject.toml ${CONTAINER_NAME}:/pyproject.toml
export-poetry-files: ## Exports poetry files from inside container
Expand Down
Loading

0 comments on commit fb48f71

Please sign in to comment.