Skip to content

Commit

Permalink
Aplly fixes and suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-p-marques committed Jan 21, 2021
1 parent 7f9b5ee commit 1bdf6b7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
14 changes: 4 additions & 10 deletions src/.github/workflows/ci.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,16 @@ env:
jobs:
{%- if pytest %}
build-test:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
python:
{%- for version in python_versions or ['3.9'] %}
- {{ version }}
{%- endfor %}
steps:
# Prepare Docker environment
# Prepare environment
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
# Set up and run tests
- name: Install python
uses: actions/setup-python@v1
Expand Down Expand Up @@ -70,7 +68,7 @@ jobs:
- run: poetry run pytest --prebuild
{%- endif %}
build-push:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
services:
registry:
image: registry:2
Expand Down Expand Up @@ -100,11 +98,9 @@ jobs:
with:
driver-opts: network=host
install: true
- name: Get date
run: echo "BUILD_DATE=$(date --rfc-3339 ns)" >> $GITHUB_ENV
# Build and push
- name: Docker meta for local images
id: docker_meta_private
id: docker_meta_local
uses: crazy-max/ghaction-docker-meta@v1
with:
{%- raw %}
Expand All @@ -131,7 +127,6 @@ jobs:
labels: ${{ steps.docker_meta_local.outputs.labels }}
tags: ${{ steps.docker_meta_local.outputs.tags }}
build-args: |
BUILD_DATE=${{ env.BUILD_DATE }}
VCS_REF=${{ github.sha }}
{%- endraw %}
{% if dockerhub_image or push_to_ghcr -%}
Expand Down Expand Up @@ -191,7 +186,6 @@ jobs:
labels: ${{ steps.docker_meta_public.outputs.labels }}
tags: ${{ steps.docker_meta_public.outputs.tags }}
build-args: |
BUILD_DATE=${{ env.BUILD_DATE }}
VCS_REF=${{ github.sha }}
{%- endraw %}
{% endif %}
2 changes: 1 addition & 1 deletion src/README.md.jinja
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[![Last template update](https://img.shields.io/badge/last%20template%20update-{{ _copier_answers._commit|replace('-', '--') }}-informational)](https://github.com/Tecnativa/image-template/tree/{{ _copier_answers._commit }})
[![Last image-template](https://img.shields.io/badge/last%20template%20update-{{ _copier_answers._commit|replace('-', '--') }}-informational)](https://github.com/Tecnativa/image-template/tree/{{ _copier_answers._commit }})

# {{ project_name }}
2 changes: 1 addition & 1 deletion src/{% if pytest %}tests{% endif %}/conftest.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def pytest_addoption(parser):
parser.addoption(
"--image",
action="store",
default="{{ project_name }}-test:latest",
default="test:{{ project_name }}",
help="Specify testing image name",
)

Expand Down

0 comments on commit 1bdf6b7

Please sign in to comment.