diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index af8aaf7..94a62b0 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -2,6 +2,7 @@ name: build checker run-name: Build and Python images on: + pull_request: push: branches-ignore: main env: @@ -22,52 +23,10 @@ jobs: python-version: 3.12 - name: install dependencies - run: pip install -r requirements.txt + run: pip install -r requirements/requirements.txt - - name: Create Dockerfiles of Python Images - run: python ./src/parse.py + - name: install dev dependencies + run: pip install -r requirements/requirements-dev.txt - - uses: danyow/json-matrix-builder@v0.5.0 - id: array - with: - cmd: ls Python_dockerfiles - separator: newline - - name: "Upload Artifact" - uses: actions/upload-artifact@v4 - with: - name: Generated_Dockerfiles - path: Python_dockerfiles/ - retention-days: 1 - outputs: - param: ${{ steps.array.outputs.build }} - - matrix_input: - permissions: - contents: read - packages: write - id-token: write - needs: setup - runs-on: ubuntu-latest - strategy: - matrix: - param: ${{ fromJson(needs.setup.outputs.param) }} - - steps: - - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - name: Generated_Dockerfiles - - - name: building images - run: | - tags=$(cat ${{matrix.param}}/tags.txt) - IFS=$'\n' - for tag in $tags; do - docker build -q --file ${{matrix.param}}/Dockerfile --tag ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:$tag . - done - - - name: delete artifacts - uses: geekyeggo/delete-artifact@v1 - with: - name: Generated_Dockerfiles + - name: Run tests + run: python -m pytest \ No newline at end of file diff --git a/.gitignore b/.gitignore index 679920f..4709a8d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,7 @@ __pycache__ .env # ide-staff -.vscode \ No newline at end of file +.vscode + +# Unit test +.pytest_cache \ No newline at end of file diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt new file mode 100644 index 0000000..2841e33 --- /dev/null +++ b/requirements/requirements-dev.txt @@ -0,0 +1,5 @@ +colorama==0.4.6 +iniconfig==2.0.0 +packaging==24.0 +pluggy==1.5.0 +pytest==8.2.2 diff --git a/requirements.txt b/requirements/requirements.txt similarity index 100% rename from requirements.txt rename to requirements/requirements.txt