From e580c72b9267bc83d05e101956d8729d6edbadbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nepo=20Rojas=20=E2=80=A2=20GECI?= Date: Mon, 11 Nov 2024 13:22:37 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=A0=F0=9F=91=B7=F0=9F=8F=BF=E2=80=8D?= =?UTF-8?q?=E2=99=80=EF=B8=8F=20Update=20actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/actions.yml | 121 ++++++++++++++++++++++++++++++---- 1 file changed, 109 insertions(+), 12 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 9a939bd..3be8393 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -1,17 +1,114 @@ -name: Conservación de Islas -on: [push, pull_request] - +name: Push latest +on: + push: + branches: + - develop jobs: - actions: - runs-on: ubuntu-18.04 + build-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/mean_differences_mc:latest + outputs: type=docker,dest=/tmp/image.tar + - name: Upload artifact + uses: actions/upload-artifact@main + with: + name: image + path: /tmp/image.tar + + tests: + needs: build-image + runs-on: ubuntu-latest steps: + - 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: Copia repositorio - uses: actions/checkout@v2 - - name: Construye imagen - run: docker build --tag islasgeci . + uses: actions/checkout@main - name: Verifica el formato - run: docker run islasgeci make check + run: docker run islasgeci/mean_differences_mc:latest make check - name: Corre pruebas y evalúa cobertura - run: docker run islasgeci make coverage - - name: Evalua resistencia a mutaciones - run: docker run islasgeci make mutants + run: docker run --volume $PWD:/workdir islasgeci/mean_differences_mc:latest make coverage + - name: Upload coverage reports to Codecov with GitHub Action + uses: codecov/codecov-action@v3 + with: + files: ./coverage.xml + verbose: true + - name: Create/Update tag + uses: rickstaa/action-create-tag@v1.5.4 + 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/mean_differences_mc:latest + - name: Add github sha tag to Docker image + run: docker tag islasgeci/mean_differences_mc:latest islasgeci/mean_differences_mc:${GITHUB_SHA:0:4} + - name: Sube sha a Docker Hub + run: docker push islasgeci/mean_differences_mc:${GITHUB_SHA:0:4} + + mutants: + runs-on: ubuntu-latest + needs: tests + steps: + - 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: Copia repositorio + uses: actions/checkout@main + - name: Evalúa resistencia a mutaciones + run: docker run islasgeci/mean_differences_mc:latest make mutants + + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to PyPI + runs-on: ubuntu-latest + needs: tests + steps: + - uses: actions/checkout@main + - name: Set up Python 3.9 + uses: actions/setup-python@v1 + with: + python-version: 3.9 + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + . + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_TOKEN }} + skip-existing: true