Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
teemu61 committed Feb 13, 2025
1 parent 6313ebc commit cb33718
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 61 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ env:
DOCKER_IMAGE: dataeng

jobs:

git-tag-and-push:
runs-on:
- ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Pull request

on:

workflow_dispatch: { }

jobs:
Expand Down
118 changes: 59 additions & 59 deletions dataeng/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PACKAGE := dataeng

CONTAINER := dataeng
REGISTRY := europe-north1-docker.pkg.dev/vivid-env-450617-g5/teemu-images/dataeng
REGISTRY := europe-north1-docker.pkg.dev/vivid-env-450617-g5/teemu-images/
TAG ?= latest

# Get version from package __init__ file:
Expand All @@ -19,72 +19,72 @@ docker: run-tests version.json
docker buildx build --secret id=gcp_secret,src=$(HOME)/.config/gcloud/application_default_credentials.json --platform linux/amd64 -t $(CONTAINER) --pull=true .
rm -rf version.json

version.json:
@echo "{\"container\": \"$(CONTAINER)\", \
\"registry\": \"$(REGISTRY)\", \
\"repository\": \"$(shell git config remote.origin.url)\", \
\"commit\": \"$(shell git rev-parse HEAD)\", \
\"date\": \"$(shell date +"%Y%m%dT%H%M")\", \
\"by\": {\
\"name\": \"$(shell git config user.name)\", \
\"email\": \"$(shell git config user.email)\"\
}}" | python3 -m json.tool | tee $@

.PHONY: clean
clean:
git clean -Xdf -e '!*.iml'

.PHONY: re
re: clean all

# project specific makefile rules
.built:
pipenv sync --dev
touch .built

.PHONY: run-tests
run-tests: .built
pipenv run python3 -X dev -m pytest -rs --junitxml=pytests.xml --cov-branch --cov-report=term --cov-report=xml:coverage.xml --cov-report=html --cov=$(PACKAGE) tests

.PHONY: pycodestyle
pycodestyle: .built
pipenv run pycodestyle --statistics --$(shell grep 'max-line-length=' .pylintrc) $(PACKAGE)

.PHONY: vulture
vulture: .built
pipenv run vulture --min-confidence=90 $(PACKAGE)

.PHONY: pylintchecker
pylintchecker: .built
pipenv run pylint --rcfile=.pylintrc --fail-under=9.7 $(PACKAGE)
# version.json:
# @echo "{\"container\": \"$(CONTAINER)\", \
# \"registry\": \"$(REGISTRY)\", \
# \"repository\": \"$(shell git config remote.origin.url)\", \
# \"commit\": \"$(shell git rev-parse HEAD)\", \
# \"date\": \"$(shell date +"%Y%m%dT%H%M")\", \
# \"by\": {\
# \"name\": \"$(shell git config user.name)\", \
# \"email\": \"$(shell git config user.email)\"\
# }}" | python3 -m json.tool | tee $@

# .PHONY: clean
# clean:
# git clean -Xdf -e '!*.iml'

# .PHONY: re
# re: clean all

# # project specific makefile rules
# .built:
# pipenv sync --dev
# touch .built

# .PHONY: run-tests
# run-tests: .built
# pipenv run python3 -X dev -m pytest -rs --junitxml=pytests.xml --cov-branch --cov-report=term --cov-report=xml:coverage.xml --cov-report=html --cov=$(PACKAGE) tests

# .PHONY: pycodestyle
# pycodestyle: .built
# pipenv run pycodestyle --statistics --$(shell grep 'max-line-length=' .pylintrc) $(PACKAGE)

# .PHONY: vulture
# vulture: .built
# pipenv run vulture --min-confidence=90 $(PACKAGE)

# .PHONY: pylintchecker
# pylintchecker: .built
# pipenv run pylint --rcfile=.pylintrc --fail-under=9.7 $(PACKAGE)

.PHONY: mypy
mypy: .built
pipenv run mypy --ignore-missing-imports -i $(PACKAGE);
# mypy: .built
# pipenv run mypy --ignore-missing-imports -i $(PACKAGE);

.PHONY: lint
lint: pylintchecker vulture pycodestyle mypy
# .PHONY: lint
# lint: pylintchecker vulture pycodestyle mypy

.PHONY: deps-check
deps-check:
mkdir -p reports && dependency-check --cveValidForHours 24 --out reports --format ALL \
--enableExperimental --disableAssembly --disableBundleAudit --disableNodeJS --disableOssIndex \
--scan $(PACKAGE) --project $(PACKAGE)
# .PHONY: deps-check
# deps-check:
# mkdir -p reports && dependency-check --cveValidForHours 24 --out reports --format ALL \
# --enableExperimental --disableAssembly --disableBundleAudit --disableNodeJS --disableOssIndex \
# --scan $(PACKAGE) --project $(PACKAGE)

.PHONY: beautify
beautify: .built
pipenv run yapf --in-place --parallel -vv --recursive --style='{based_on_style: google, column_limit:120, allow_split_before_dict_value: false}' $(PACKAGE) tests
# .PHONY: beautify
# beautify: .built
# pipenv run yapf --in-place --parallel -vv --recursive --style='{based_on_style: google, column_limit:120, allow_split_before_dict_value: false}' $(PACKAGE) tests

.PHONY: git-tag-test
git-tag-test:
git tag $(VERSION)
# .PHONY: git-tag-test
# git-tag-test:
# git tag $(VERSION)

.PHONY: git-tag-and-push
git-tag-and-push:
git tag -a $(VERSION) -m v$(VERSION) && git push origin $(VERSION)

.PHONY: valkama
valkama: docker
@echo "Tagging '$(CONTAINER)' as '$(TAG)' and pushing into $(REGISTRY)"
docker tag $(CONTAINER) $(REGISTRY)/$(CONTAINER):$(TAG)
docker push $(REGISTRY)/$(CONTAINER):$(TAG) || echo "hint: use 'docker login $(REGISTRY)' to authenticate"
# .PHONY: valkama
# valkama: docker
# @echo "Tagging '$(CONTAINER)' as '$(TAG)' and pushing into $(REGISTRY)"
# docker tag $(CONTAINER) $(REGISTRY)/$(CONTAINER):$(TAG)
# docker push $(REGISTRY)/$(CONTAINER):$(TAG) || echo "hint: use 'docker login $(REGISTRY)' to authenticate"

0 comments on commit cb33718

Please sign in to comment.