diff --git a/.github/workflows/code-reports.yml b/.github/workflows/code-reports.yml index 87ad37d5..4e06c9b2 100644 --- a/.github/workflows/code-reports.yml +++ b/.github/workflows/code-reports.yml @@ -2,39 +2,38 @@ name: Create Code Reports on: push: - branches: [ master ] + branches: [master] workflow_dispatch: jobs: create-coverage-report: runs-on: ubuntu-latest - + steps: - - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e - with: - php-version: '8.0' - coverage: xdebug - extensions: fileinfo - - name: Install Hyde - run: git clone https://github.com/hydephp/hyde.git $(pwd) - - name: Install Dependencies - run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - - name: Set Framework version to dev-master - run: composer require hyde/framework:dev-master - - name: Set environment to testing - run: echo "ENV=testing" > .env - - name: Run tests with HTML coverage reporting - run: vendor/bin/pest --coverage-html covrep - env: - ENV: testing - - - name: Upload the report as an artifact - uses: actions/upload-artifact@v1 - with: - name: 'coverage-report' - path: 'covrep' - + - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e + with: + php-version: "8.0" + coverage: xdebug + extensions: fileinfo + - name: Install Hyde + run: git clone https://github.com/hydephp/hyde.git $(pwd) + - name: Install Dependencies + run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + - name: Set Framework version to dev-master + run: composer require hyde/framework:dev-master + - name: Set environment to testing + run: echo "ENV=testing" > .env + - name: Run tests with HTML coverage reporting + run: vendor/bin/pest --coverage-html covrep + env: + ENV: testing + + - name: Upload the report as an artifact + uses: actions/upload-artifact@v1 + with: + name: "coverage-report" + path: "covrep" build-php-docs: runs-on: ubuntu-latest @@ -53,10 +52,9 @@ jobs: - name: Upload the documentation as an artifact uses: actions/upload-artifact@v1 with: - name: 'api-docs' - path: 'api-docs' - - + name: "api-docs" + path: "api-docs" + upload-html-files: needs: [create-coverage-report, build-php-docs] runs-on: ubuntu-latest diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 0e72a00e..bdcdf9b5 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -4,7 +4,7 @@ # # Source repository: https://github.com/actions/dependency-review-action # Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement -name: 'Dependency Review' +name: "Dependency Review" on: [pull_request] permissions: @@ -14,7 +14,7 @@ jobs: dependency-review: runs-on: ubuntu-latest steps: - - name: 'Checkout Repository' + - name: "Checkout Repository" uses: actions/checkout@v3 - - name: 'Dependency Review' + - name: "Dependency Review" uses: actions/dependency-review-action@v1 diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 530c4333..22f50747 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -1,9 +1,9 @@ name: Test Suite (Matrix) on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] jobs: # First run tests with coverage. If this fails, we don't need to run the matrix. @@ -11,36 +11,36 @@ jobs: runs-on: ubuntu-latest steps: - - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e - with: - php-version: '8.0' - coverage: xdebug - extensions: fileinfo - - name: Install Hyde - run: git clone https://github.com/hydephp/hyde.git $(pwd) - - name: Install Dependencies - run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - - name: Set Framework version to dev-github.ref_name - run: 'composer require hyde/framework:dev-${{ github.ref_name }}' - - name: Set environment to testing - run: echo "ENV=testing" > .env - - name: Output debug information - run: php hyde debug - - name: Run tests with output coverage reporting - run: vendor/bin/pest --coverage - env: - ENV: testing + - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e + with: + php-version: "8.0" + coverage: xdebug + extensions: fileinfo + - name: Install Hyde + run: git clone https://github.com/hydephp/hyde.git $(pwd) + - name: Install Dependencies + run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + - name: Set Framework version to dev-github.ref_name + run: "composer require hyde/framework:dev-${{ github.ref_name }}" + - name: Set environment to testing + run: echo "ENV=testing" > .env + - name: Output debug information + run: php hyde debug + - name: Run tests with output coverage reporting + run: vendor/bin/pest --coverage + env: + ENV: testing - - name: Run tests and save coverage to file - run: vendor/bin/pest --coverage-text=report.txt - env: - ENV: testing + - name: Run tests and save coverage to file + run: vendor/bin/pest --coverage-text=report.txt + env: + ENV: testing - - name: Upload the report as an artifact - uses: actions/upload-artifact@v1 - with: - name: 'report.txt' - path: 'report.txt' + - name: Upload the report as an artifact + uses: actions/upload-artifact@v1 + with: + name: "report.txt" + path: "report.txt" hyde-tests: needs: test-coverage @@ -51,22 +51,22 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e - with: - php-version: '8.0' - extensions: fileinfo - - name: Install Hyde - run: git clone https://github.com/hydephp/hyde.git $(pwd) - - name: Install Dependencies - run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - - name: Set Framework version to dev-github.ref_name - run: 'composer require hyde/framework:dev-${{ github.ref_name }}' - - name: Set environment to testing - run: echo "ENV=testing" > .env - - name: Execute tests (Unit and Feature tests) via PHPUnit/Pest - run: vendor/bin/pest - env: - ENV: testing + - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e + with: + php-version: "8.0" + extensions: fileinfo + - name: Install Hyde + run: git clone https://github.com/hydephp/hyde.git $(pwd) + - name: Install Dependencies + run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + - name: Set Framework version to dev-github.ref_name + run: "composer require hyde/framework:dev-${{ github.ref_name }}" + - name: Set environment to testing + run: echo "ENV=testing" > .env + - name: Execute tests (Unit and Feature tests) via PHPUnit/Pest + run: vendor/bin/pest + env: + ENV: testing update-coverage-badge: runs-on: ubuntu-latest @@ -74,33 +74,32 @@ jobs: if: github.event_name == 'push' steps: - - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e - with: - php-version: '8.0' - extensions: fileinfo - - - name: Download report - uses: actions/download-artifact@v3 - with: - name: report.txt - path: report.txt + - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e + with: + php-version: "8.0" + extensions: fileinfo - - name: Download Coverage Parser - run: 'wget https://gist.githubusercontent.com/caendesilva/75a5ff8dd4e23921b75f503149655924/raw/456bd4bae423eda2a3ff2ba2ce8f8246f366d46f/parser.php' - - name: Run the parser - id: run-coverage-parser - run: echo ::set-output name=average_coverage::$(php parser.php) - - name: Output the value - run: echo Result ${{ steps.run-coverage-parser.outputs.average_coverage }} - - name: Post the result to server - run: 'curl -X POST https://cdn.desilva.se/microservices/coverbadges/api.php -H "Content-Type: application/x-www-form-urlencoded" -d "repo=https://github.com/hydephp/hyde&value=${{ steps.run-coverage-parser.outputs.average_coverage }}&token=${{ secrets.COVERBADGES_SECRET }}"' + - name: Download report + uses: actions/download-artifact@v3 + with: + name: report.txt + path: report.txt - - name: Download the SVG badge - run: 'wget https://cdn.desilva.se/microservices/coverbadges/badges/9b8f6a9a7a48a2df54e6751790bad8bd910015301e379f334d6ec74c4c3806d1.svg' - - - name: Upload the SVG badge as an artifact - uses: actions/upload-artifact@v1 - with: - name: 'badge.svg' - path: '9b8f6a9a7a48a2df54e6751790bad8bd910015301e379f334d6ec74c4c3806d1.svg' - \ No newline at end of file + - name: Download Coverage Parser + run: "wget https://gist.githubusercontent.com/caendesilva/75a5ff8dd4e23921b75f503149655924/raw/456bd4bae423eda2a3ff2ba2ce8f8246f366d46f/parser.php" + - name: Run the parser + id: run-coverage-parser + run: echo ::set-output name=average_coverage::$(php parser.php) + - name: Output the value + run: echo Result ${{ steps.run-coverage-parser.outputs.average_coverage }} + - name: Post the result to server + run: 'curl -X POST https://cdn.desilva.se/microservices/coverbadges/api.php -H "Content-Type: application/x-www-form-urlencoded" -d "repo=https://github.com/hydephp/hyde&value=${{ steps.run-coverage-parser.outputs.average_coverage }}&token=${{ secrets.COVERBADGES_SECRET }}"' + + - name: Download the SVG badge + run: "wget https://cdn.desilva.se/microservices/coverbadges/badges/9b8f6a9a7a48a2df54e6751790bad8bd910015301e379f334d6ec74c4c3806d1.svg" + + - name: Upload the SVG badge as an artifact + uses: actions/upload-artifact@v1 + with: + name: "badge.svg" + path: "9b8f6a9a7a48a2df54e6751790bad8bd910015301e379f334d6ec74c4c3806d1.svg" diff --git a/.github/workflows/update-filecache.yml b/.github/workflows/update-filecache.yml index 373b35f7..29bfed51 100644 --- a/.github/workflows/update-filecache.yml +++ b/.github/workflows/update-filecache.yml @@ -2,7 +2,7 @@ name: Update Filecache on: push: - branches: [ master ] + branches: [master] workflow_dispatch: @@ -15,23 +15,23 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - name: Compile the checksums and save the filecache - run: cd resources/data && php filecacheGenerator.php - - - name: Check if any changes were made - uses: tj-actions/verify-changed-files@v9 - id: verify-changed-files - with: - files: resources/data/filecache.json - - - name: Create Pull Request with the new filecache - if: steps.verify-changed-files.outputs.files_changed == 'true' - uses: peter-evans/create-pull-request@v4 - with: - commit-message: Automatic Filecache Update - title: Update Filecache - body: Updated the filecache.json with new resource file checksums. - branch: update-checksums - base: master + - uses: actions/checkout@v3 + + - name: Compile the checksums and save the filecache + run: cd resources/data && php filecacheGenerator.php + + - name: Check if any changes were made + uses: tj-actions/verify-changed-files@v9 + id: verify-changed-files + with: + files: resources/data/filecache.json + + - name: Create Pull Request with the new filecache + if: steps.verify-changed-files.outputs.files_changed == 'true' + uses: peter-evans/create-pull-request@v4 + with: + commit-message: Automatic Filecache Update + title: Update Filecache + body: Updated the filecache.json with new resource file checksums. + branch: update-checksums + base: master diff --git a/.github/workflows/update-hydefront.yml b/.github/workflows/update-hydefront.yml index b63e982a..0e5d2391 100644 --- a/.github/workflows/update-hydefront.yml +++ b/.github/workflows/update-hydefront.yml @@ -2,7 +2,7 @@ name: Update Hydefront on: push: - branches: [ master ] + branches: [master] workflow_dispatch: @@ -14,19 +14,18 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - name: Create pull request - uses: paygoc6/action-pull-request-another-repo@v1.0.1 - env: - API_TOKEN_GITHUB: ${{ secrets.PAT }} - with: - source_folder: 'resources/assets/.' - destination_folder: '/' - destination_repo: 'hydephp/hydefront' - destination_base_branch: 'master' - destination_head_branch: 'framework-merge' - user_email: 'hydephp@github.com' - user_name: 'hydephp' - pull_request_reviewers: 'reviewers' + - uses: actions/checkout@v3 + - name: Create pull request + uses: paygoc6/action-pull-request-another-repo@v1.0.1 + env: + API_TOKEN_GITHUB: ${{ secrets.PAT }} + with: + source_folder: "resources/assets/." + destination_folder: "/" + destination_repo: "hydephp/hydefront" + destination_base_branch: "master" + destination_head_branch: "framework-merge" + user_email: "hydephp@github.com" + user_name: "hydephp" + pull_request_reviewers: "reviewers"