generated from IslasGECI/dummy_transformations
-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (143 loc) · 4.1 KB
/
actions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Push latest
on:
push:
branches:
- develop
jobs:
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/api_caller:latest
outputs: type=docker,dest=/tmp/image.tar
- name: Upload artifact
uses: actions/upload-artifact@main
with:
name: image
path: /tmp/image.tar
run-tests:
needs: build-image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- 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/api_caller:latest make check
- name: Corre pruebas y evalúa cobertura
run: docker compose run islasgeci make coverage
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
verbose: true
- name: Teardown services
run: |
docker compose down
mutation-testing:
needs: build-image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- 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: Evalúa resistencia a mutaciones
run: docker compose run islasgeci make mutants
- name: Teardown services
run: |
docker compose down
test-service:
needs: build-image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- 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: Execute tests in the running services
run: |
docker compose run islasgeci make test-services
- name: Teardown services
run: |
docker compose down
deploy-image-and-package:
needs: [run-tests, test-service]
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@main
- name: Create/Update tag
uses: rickstaa/action-create-tag@v1.5.4
with:
tag: "latest"
message: "Latest release"
force_push_tag: true
- 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: 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/api_caller:latest
- name: Add github sha tag to Docker image
run: docker tag islasgeci/api_caller:latest islasgeci/api_caller:${GITHUB_SHA:0:4}
- name: Sube sha a Docker Hub
run: docker push islasgeci/api_caller:${GITHUB_SHA:0:4}
- name: Build and publish Python 🐍 distributions 📦 to PyPI
uses: actions/setup-python@v5
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 }}