Skip to content

Commit

Permalink
💫👷 Update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nepito authored Apr 18, 2024
1 parent a5c4a8b commit ae44f49
Showing 1 changed file with 39 additions and 19 deletions.
58 changes: 39 additions & 19 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,68 @@ on:
branches:
- develop
jobs:
actions:
build-image:
name: Build Docker image 🐋
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@main
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and export
uses: docker/build-push-action@v5
with:
context: .
tags: islasgeci/dummy_transformations:latest
outputs: type=docker,dest=/tmp/image.tar
- name: Upload artifact
uses: actions/upload-artifact@main
with:
name: image
path: /tmp/image.tar

test-module:
name: Test Python module 🐍
needs: build-image
runs-on: ubuntu-latest
steps:
- name: Copia repositorio
uses: actions/checkout@main
- name: Construye imagen
run: docker build --tag islasgeci/dummy_transformations:latest --tag islasgeci/dummy_transformations:${GITHUB_SHA:0:4} .
- name: Download artifact
uses: actions/download-artifact@main
with:
name: image
path: /tmp
- name: Load image
run: |
docker load --input /tmp/image.tar
docker image ls -a
- name: Verifica el formato
run: docker run islasgeci/dummy_transformations:latest make check
- name: Corre pruebas y evalúa cobertura
run: docker run --volume $PWD:/workdir islasgeci/dummy_transformations:latest make coverage
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@main
with:
files: ./coverage.xml
verbose: true
- name: Evalúa resistencia a mutaciones
run: docker run islasgeci/dummy_transformations:latest make mutants
- name: Create/Update tag
uses: rickstaa/[email protected]
with:
tag: "latest"
message: "Latest release"
force_push_tag: true
- name: Docker log-in
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
- name: Sube latest a Docker Hub
run: docker push islasgeci/dummy_transformations:latest
- name: Sube sha a Docker Hub
run: docker push islasgeci/dummy_transformations:${GITHUB_SHA:0:4}

build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
needs: test-module
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Set up Python 3.9
uses: actions/setup-python@v1
- name: Set up Python 3.X
uses: actions/setup-python@main
with:
python-version: 3.9
python-version: "3.x"
- name: Install pypa/build
run: >-
python -m
Expand All @@ -64,4 +84,4 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
skip_existing: true
skip-existing: true

0 comments on commit ae44f49

Please sign in to comment.