diff --git a/.github/workflows/dockerhub-main-push.yml b/.github/workflows/dockerhub-main-push.yml new file mode 100644 index 0000000..bed4d7b --- /dev/null +++ b/.github/workflows/dockerhub-main-push.yml @@ -0,0 +1,26 @@ +name: DockerHub Main Push + +on: + workflow_run: + workflows: ["Unittest Main Push"] + types: + - completed +jobs: + build: + runs-on: ubuntu-latest + steps: + - + name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + tags: oislen/randomtelecompayments:latest \ No newline at end of file diff --git a/.github/workflows/unittest-main.yml b/.github/workflows/unittest-main-pr.yml similarity index 93% rename from .github/workflows/unittest-main.yml rename to .github/workflows/unittest-main-pr.yml index 74042f5..9a2a731 100644 --- a/.github/workflows/unittest-main.yml +++ b/.github/workflows/unittest-main-pr.yml @@ -1,8 +1,6 @@ -name: Unittest Main +name: Unittest Main Pull Request on: - push: - branches: [ "main" ] pull_request: branches: [ "main" ] diff --git a/.github/workflows/unittest-main-push.yml b/.github/workflows/unittest-main-push.yml new file mode 100644 index 0000000..a123ff3 --- /dev/null +++ b/.github/workflows/unittest-main-push.yml @@ -0,0 +1,29 @@ +name: Unittest Main Push + +on: + push: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.11"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install python dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Test with unittest + run: | + python -m unittest discover ./scripts/unittests/utilities + python -m unittest discover ./scripts/unittests/objects