diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 00000000..5af129c5 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,28 @@ +name: Build + +on: + push: + branches: + - "*" + +jobs: + build: + name: Create Build + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Permissions + run: chmod +x build.sh + shell: bash + + - name: Build + run: ./build.sh + shell: bash + + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: touchpoint-wp + path: build diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 5b1c26a6..fd518b65 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -1,23 +1,26 @@ +name: Create Release + on: push: tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 - -name: Create Release + - 'v*' # Push events matching v*, i.e. v1.0, v20.15.10 jobs: - build: + release: name: Create Release runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 + - name: Permissions run: chmod +x build.sh shell: bash + - name: Build run: ./build.sh shell: bash + - name: Create Release id: create_release uses: actions/create-release@v1 @@ -28,6 +31,7 @@ jobs: release_name: Release ${{ github.ref }} draft: true prerelease: false + - name: Publish Built zip uses: actions/upload-release-asset@v1 env: @@ -36,4 +40,15 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./touchpoint-wp.zip asset_name: touchpoint-wp.zip - asset_content_type: application/zip \ No newline at end of file + asset_content_type: application/zip + + docs: + name: Update Documentation + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Generate Docs + run: php ./generateDocs.php + shell: bash \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..9dc814a3 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,62 @@ +name: Tests + +on: + push: + branches: + - "*" + pull_request: + branches: + - "*" + +permissions: + contents: read + +jobs: + test: + name: Run PHPUnit Tests + runs-on: ubuntu-latest + + strategy: + matrix: + php-version: ['8.0', '8.1', '8.2', '8.3'] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: json, zip, dom + coverage: xdebug + + - name: Validate composer.json + run: composer validate --strict --no-check-version + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php-${{ matrix.php-version }}- + + - name: Install dependencies + run: composer update --prefer-dist --no-progress # use update to allow for different php versions in matrix. + + + - name: Run test suite + run: composer test + + - name: Generate coverage report (PHP 8.3 only) + if: matrix.php-version == '8.3' + run: ./vendor/bin/phpunit --coverage-clover coverage.xml + + - name: Upload coverage to artifact (PHP 8.3 only) + if: matrix.php-version == '8.3' + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: coverage.xml diff --git a/.gitignore b/.gitignore index b290ba17..072ebc4b 100644 --- a/.gitignore +++ b/.gitignore @@ -12,14 +12,22 @@ composer.lock /.idea/deployment.xml /.idea/dataSources.xml /.idea/webServers.xml +/.idea/runConfigurations/Local.xml +/.idea/copilotDiffState.xml +/.idea/data_source_mapping.xml +/.idea/copilot* *.min.js node_modules /i18n/*.json /i18n/*.mo - -package-lock.json +/i18n/*.l10n.php /build/ -/touchpoint-wp.zip \ No newline at end of file +/touchpoint-wp.zip + +# Test artifacts +/.phpunit.cache/ +/coverage/ +.phpunit.result.cache diff --git a/.idea/.gitignore b/.idea/.gitignore index 13566b81..a9d7db9c 100644 --- a/.idea/.gitignore +++ b/.idea/.gitignore @@ -6,3 +6,5 @@ # Datasource local storage ignored files /dataSources/ /dataSources.local.xml +# GitHub Copilot persisted chat sessions +/copilot/chatSessions diff --git a/.idea/TouchPoint-WP.iml b/.idea/TouchPoint-WP.iml index 9431eab8..37ede893 100644 --- a/.idea/TouchPoint-WP.iml +++ b/.idea/TouchPoint-WP.iml @@ -5,10 +5,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 2ca38701..fd81ac46 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -3,7 +3,9 @@