Spaces:
Runtime error
Runtime error
fix dipendenza pipeline CI CD
Browse files- .github/workflows/CD_docker.yml +2 -3
- .github/workflows/test_ci.yml +5 -0
- CI/test_ci.py +2 -2
.github/workflows/CD_docker.yml
CHANGED
|
@@ -1,10 +1,9 @@
|
|
| 1 |
#
|
| 2 |
name: CD docker
|
| 3 |
|
| 4 |
-
#
|
| 5 |
on:
|
| 6 |
-
|
| 7 |
-
branches: ['main']
|
| 8 |
|
| 9 |
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
|
| 10 |
env:
|
|
|
|
| 1 |
#
|
| 2 |
name: CD docker
|
| 3 |
|
| 4 |
+
# Viene chiamato dalla pipeline CI se termina OK
|
| 5 |
on:
|
| 6 |
+
workflow_call:
|
|
|
|
| 7 |
|
| 8 |
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
|
| 9 |
env:
|
.github/workflows/test_ci.yml
CHANGED
|
@@ -38,3 +38,8 @@ jobs:
|
|
| 38 |
- name: Test with pytest
|
| 39 |
run: |
|
| 40 |
pytest
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
- name: Test with pytest
|
| 39 |
run: |
|
| 40 |
pytest
|
| 41 |
+
|
| 42 |
+
job_call_cd: # Sblocca la pipeline CD se tutto va OK
|
| 43 |
+
needs: job_test
|
| 44 |
+
uses: ./.github/workflows/CD_docker.yml
|
| 45 |
+
secrets: inherit # Passa il token
|
CI/test_ci.py
CHANGED
|
@@ -17,7 +17,7 @@ class TestClass :
|
|
| 17 |
|
| 18 |
def test_accuracy(self) :
|
| 19 |
# Controllo che l'accuracy sia almeno 0.5
|
| 20 |
-
X = ld.
|
| 21 |
-
y = ld.
|
| 22 |
y_pred = model.predict(X)
|
| 23 |
assert accuracy_score(y, y_pred)>=0.5
|
|
|
|
| 17 |
|
| 18 |
def test_accuracy(self) :
|
| 19 |
# Controllo che l'accuracy sia almeno 0.5
|
| 20 |
+
X = ld.X
|
| 21 |
+
y = ld.y
|
| 22 |
y_pred = model.predict(X)
|
| 23 |
assert accuracy_score(y, y_pred)>=0.5
|