diff --git a/.dockerignore b/.dockerignore index 1d86eeb..703fc3d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,5 @@ .idea/ .DS_Store vendor/ -.phpunit.cache/ \ No newline at end of file +.phpunit.cache/ +tests/ \ No newline at end of file diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 2287a00..03a945c 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -246,10 +246,23 @@ jobs: siteworxpro/composer \ install --ignore-platform-reqs --no-interaction --prefer-dist --optimize-autoloader - - name: Run Unit Tests - run: | - docker run --rm \ - --volumes-from ${{ env.JOB_CONTAINER_NAME }} \ - -w ${{ github.workspace }} \ - siteworxpro/composer \ - run tests:unit + - name: ๐Ÿงช โœ… Run Unit Tests + uses: addnab/docker-run-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + image: siteworxpro/composer + options: --volumes-from ${{ env.JOB_CONTAINER_NAME }} -w ${{ gitea.workspace }} + run: | + bin/pcov.sh + composer run tests:unit:coverage + +# - name: ๐Ÿ“ฆ Publish Build Artifacts +# env: +# NODE_TLS_REJECT_UNAUTHORIZED: 0 +# uses: christopherhx/gitea-upload-artifact@v4 +# with: +# options: --volumes-from ${{ env.JOB_CONTAINER_NAME }} -w ${{ gitea.workspace }} +# name: junit-coverage.xml +# path: tests/reports/junit.xml +# retention-days: 1 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1d86eeb..d1a6129 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .idea/ .DS_Store vendor/ -.phpunit.cache/ \ No newline at end of file +.phpunit.cache/ + +tests/reports/ \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 77ce985..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,5 +0,0 @@ -include: - - local: .gitlab/ci/stages.yml - - local: .gitlab/ci/tests.yml - - local: .gitlab/ci/libraries.yml - diff --git a/.gitlab/ci/libraries.yml b/.gitlab/ci/libraries.yml deleted file mode 100644 index a00f2df..0000000 --- a/.gitlab/ci/libraries.yml +++ /dev/null @@ -1,15 +0,0 @@ -Install Composer Libraries: - stage: libraries - image: siteworxpro/composer:latest - rules: - - if: '$CI_COMMIT_TAG' - when: never - - if: '$CI_PIPELINE_SOURCE == "push"' - when: always - - when: never - script: - - composer install --ignore-platform-reqs - artifacts: - paths: - - vendor/ - expire_in: 1 hour diff --git a/.gitlab/ci/stages.yml b/.gitlab/ci/stages.yml deleted file mode 100644 index b292b2d..0000000 --- a/.gitlab/ci/stages.yml +++ /dev/null @@ -1,3 +0,0 @@ -stages: - - libraries - - tests \ No newline at end of file diff --git a/.gitlab/ci/tests.yml b/.gitlab/ci/tests.yml deleted file mode 100644 index 3849b6a..0000000 --- a/.gitlab/ci/tests.yml +++ /dev/null @@ -1,65 +0,0 @@ -Unit Tests: - stage: tests - needs: - - Install Composer Libraries - rules: - - if: '$CI_COMMIT_TAG' - when: never - - if: '$CI_PIPELINE_SOURCE == "push"' - when: always - - when: never - image: siteworxpro/composer - before_script: | - bin/pcov.sh - script: | - echo "Running unit tests..." - composer run tests:unit:coverage - coverage: '/^\s*Lines:\s*\d+.\d+\%/' - artifacts: - expire_in: 1 day - reports: - junit: tests/reports/junit.xml - paths: - - tests/reports/ - -Run License Check: - stage: tests - needs: - - Install Composer Libraries - rules: - - if: '$CI_COMMIT_TAG' - when: never - - if: '$CI_PIPELINE_SOURCE == "push"' - when: on_success - - when: never - image: siteworxpro/composer - script: - - composer run tests:license - -Run Code Lint: - stage: tests - needs: - - Install Composer Libraries - rules: - - if: '$CI_COMMIT_TAG' - when: never - - if: '$CI_PIPELINE_SOURCE == "push"' - when: on_success - - when: never - image: siteworxpro/composer - script: - - composer run tests:lint - -Run Code Sniffer: - stage: tests - needs: - - Install Composer Libraries - rules: - - if: '$CI_COMMIT_TAG' - when: never - - if: '$CI_PIPELINE_SOURCE == "push"' - when: on_success - - when: never - image: siteworxpro/composer - script: - - composer run tests:phpstan \ No newline at end of file