From 8b375f78fdf8ca0047a7440c1df08fda61c9c2b5 Mon Sep 17 00:00:00 2001 From: Marc Sune Date: Tue, 21 May 2024 17:53:17 +0200 Subject: [PATCH] Tc github unit test --- .../{publish_docker.yaml => ci.yaml} | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) rename .github/workflows/{publish_docker.yaml => ci.yaml} (73%) diff --git a/.github/workflows/publish_docker.yaml b/.github/workflows/ci.yaml similarity index 73% rename from .github/workflows/publish_docker.yaml rename to .github/workflows/ci.yaml index 77bde0c..5373ef9 100644 --- a/.github/workflows/publish_docker.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,4 @@ -name: docker-publish-ghcr +name: ci on: workflow_dispatch: @@ -12,8 +12,32 @@ env: PLATFORMS: linux/amd64,linux/arm64 jobs: + unit-test: + runs-on: ubuntu-22.04 + steps: + - name: "Checkout backend(REST)" + uses: actions/checkout@v4 + with: + path: backend + fetch-depth: 0 + fetch-tags: 1 + + - name: "Unit test" + run: | + cd backend + + echo "Fix mess with tags in actions/checkout..." + git fetch -f && git fetch -f --tags + + sudo apt-get install -y make + pip3 install -r requirements.txt + + #Run tests + cd test && make test + docker_build_and_publish: runs-on: ubuntu-22.04 + needs: [unit-test] steps: - name: "Checkout backend(REST)" uses: actions/checkout@v4