From 54caac46ccd4fe46fa515d0f4937040820a09174 Mon Sep 17 00:00:00 2001 From: vlad kobilansky Date: Thu, 14 Sep 2023 09:37:53 -0400 Subject: [PATCH 1/4] adding empty commit to trigger PR run --- .github/workflows/pr-only.yaml | 39 ++++++++++++++++------------------ 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/.github/workflows/pr-only.yaml b/.github/workflows/pr-only.yaml index a6e0892..ab74f11 100644 --- a/.github/workflows/pr-only.yaml +++ b/.github/workflows/pr-only.yaml @@ -73,38 +73,35 @@ jobs: - name: Fix permission #step 2 run: chmod +x codecov - # # RUN tests an upload reports ## comment - # - name: Run Service Testsuite with Coverage - # run: vendor/bin/phpunit --testsuite="Services Tests" --coverage-clover=coverage-service.xml + # RUN tests an upload reports ## comment + - name: Run Service Testsuite with Coverage + run: vendor/bin/phpunit --testsuite="Services Tests" --coverage-clover=coverage-service.xml - # - name: Upload Service coverage report #step 3 - # run: ./codecov ${CODECOV_TOKEN} -F service -f coverage-service.xml + - name: Upload Service coverage report #step 3 + run: ./codecov ${CODECOV_TOKEN} -F service -f coverage-service.xml - # - name: Run Controller Testsuite with Coverage - # run: vendor/bin/phpunit --testsuite="Controllers Tests" --coverage-clover=coverage-controller.xml + - name: Run Controller Testsuite with Coverage + run: vendor/bin/phpunit --testsuite="Controllers Tests" --coverage-clover=coverage-controller.xml - # - name: Upload Controller coverage report - # run: ./codecov -F controller -f coverage-controller.xml + - name: Upload Controller coverage report + run: ./codecov --url https://publicqa.codecov.dev/ -F controller -f coverage-controller.xml - # - name: Run Unit Testsuite with Coverage - # run: vendor/bin/phpunit --testsuite="Unit Tests" --coverage-clover=coverage-unit.xml + - name: Run Unit Testsuite with Coverage + run: vendor/bin/phpunit --testsuite="Unit Tests" --coverage-clover=coverage-unit.xml - # - name: Upload unit coverage report - # run: ./codecov -F unit -f coverage-unit.xml + - name: Upload unit coverage report + run: ./codecov --url https://publicqa.codecov.dev/ -F unit -f coverage-unit.xml - name: Run Complete Testsuite with Coverage run: vendor/bin/phpunit --coverage-clover=coverage.xml - # - name: Upload overall coverage report - # run: ./codecov ${CODECOV_TOKEN} -F backend -f coverage.xml - - name: Upload overall coverage report to another repo - run: ./codecov -t ${CODECOV_DD_TOKEN} --url https://doordash.codecov.io -F backend -f coverage.xml + run: ./codecov -t ${CODECOV_DD_TOKEN} --url https://publicqa.codecov.dev/ -F backend -f coverage.xml - # - name: Javascript tests using Jest - # run: npm run test + - name: Javascript tests using Jest + run: npm run test - # - name: Upload Javascript coverage - # run: ./codecov -F javascript -f coverage/coverage-final.json + - name: Upload Javascript coverage + run: ./codecov --url https://publicqa.codecov.dev/ -F javascript -f coverage/coverage-final.json \ No newline at end of file From 2a3b44969122a4871e821c736bc0d81188867125 Mon Sep 17 00:00:00 2001 From: vlad kobilansky Date: Thu, 14 Sep 2023 09:39:30 -0400 Subject: [PATCH 2/4] adding workflow --- .github/workflows/pr-sh.yaml | 107 +++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 .github/workflows/pr-sh.yaml diff --git a/.github/workflows/pr-sh.yaml b/.github/workflows/pr-sh.yaml new file mode 100644 index 0000000..d651313 --- /dev/null +++ b/.github/workflows/pr-sh.yaml @@ -0,0 +1,107 @@ +on: [pull_request] +jobs: + pull-request-ci-job: + runs-on: ubuntu-20.04 + + services: + mysql-service: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: >- + --health-cmd="mysqladmin ping" + --health-interval=10s + --health-timeout=5s + --health-retries=3 + steps: + + - name: Checkout app code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: shivammathur/setup-php@verbose + with: + php-version: 8.0 + coverage: xdebug + env: + update: true + + - name: Install Composer Dependencies + run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --ignore-platform-reqs + + - name: Prepare Laravel Application + run: | + cp .env.example .env + php artisan key:generate + + - name: Create test database + run: | + mysql -uroot -h127.0.0.1 -proot -e 'CREATE DATABASE IF NOT EXISTS test;' + + - name: Setup Database + run: | + php artisan migrate --no-interaction -vvv + php artisan db:seed + + - name: Install NPM modules + run: npm i + + ### START Codecov integration ### + - name: Download Codecov binary # step 1 + run: curl -Os https://uploader.codecov.io/latest/linux/codecov + + ### STEPS below are not required, but are great to have for extra security + - name: Verify integrity get GPG + run: curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # + + - name: Get SHAsums + run: | + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig + + + ## VERIFY integrity + - name: Test Signature + run: gpgv codecov.SHA256SUM.sig codecov.SHA256SUM + + - name: Test SHAsums + run: shasum -a 256 -c codecov.SHA256SUM + + - name: Fix permission #step 2 + run: chmod +x codecov + + # RUN tests an upload reports ## comment + - name: Run Service Testsuite with Coverage + run: vendor/bin/phpunit --testsuite="Services Tests" --coverage-clover=coverage-service.xml + + - name: Upload Service coverage report #step 3 + run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev/ -F service -f coverage-service.xml + + - name: Run Controller Testsuite with Coverage + run: vendor/bin/phpunit --testsuite="Controllers Tests" --coverage-clover=coverage-controller.xml + + - name: Upload Controller coverage report + run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev/ -F controller -f coverage-controller.xml + + - name: Run Unit Testsuite with Coverage + run: vendor/bin/phpunit --testsuite="Unit Tests" --coverage-clover=coverage-unit.xml + + - name: Upload unit coverage report + run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev/ -F unit -f coverage-unit.xml + + - name: Run Complete Testsuite with Coverage + run: vendor/bin/phpunit --coverage-clover=coverage.xml + + - name: Upload overall coverage report to another repo + run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev/ -F backend -f coverage.xml + + - name: Javascript tests using Jest + run: npm run test + + - name: Upload Javascript coverage + run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev/ -F javascript -f coverage/coverage-final.json + + \ No newline at end of file From a096b48b7e7a4cf804c1c5141f9c5913c3801ef5 Mon Sep 17 00:00:00 2001 From: vlad kobilansky Date: Thu, 14 Sep 2023 09:42:40 -0400 Subject: [PATCH 3/4] adjusting upload URL --- .github/workflows/pr-sh.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-sh.yaml b/.github/workflows/pr-sh.yaml index d651313..a04ff34 100644 --- a/.github/workflows/pr-sh.yaml +++ b/.github/workflows/pr-sh.yaml @@ -78,30 +78,30 @@ jobs: run: vendor/bin/phpunit --testsuite="Services Tests" --coverage-clover=coverage-service.xml - name: Upload Service coverage report #step 3 - run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev/ -F service -f coverage-service.xml + run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev -F service -f coverage-service.xml - name: Run Controller Testsuite with Coverage run: vendor/bin/phpunit --testsuite="Controllers Tests" --coverage-clover=coverage-controller.xml - name: Upload Controller coverage report - run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev/ -F controller -f coverage-controller.xml + run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev -F controller -f coverage-controller.xml - name: Run Unit Testsuite with Coverage run: vendor/bin/phpunit --testsuite="Unit Tests" --coverage-clover=coverage-unit.xml - name: Upload unit coverage report - run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev/ -F unit -f coverage-unit.xml + run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev -F unit -f coverage-unit.xml - name: Run Complete Testsuite with Coverage run: vendor/bin/phpunit --coverage-clover=coverage.xml - name: Upload overall coverage report to another repo - run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev/ -F backend -f coverage.xml + run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev -F backend -f coverage.xml - name: Javascript tests using Jest run: npm run test - name: Upload Javascript coverage - run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev/ -F javascript -f coverage/coverage-final.json + run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev -F javascript -f coverage/coverage-final.json \ No newline at end of file From aa70061a532464c150f0ca9fadb76b0ccdc9da1f Mon Sep 17 00:00:00 2001 From: vlad kobilansky Date: Thu, 14 Sep 2023 09:59:55 -0400 Subject: [PATCH 4/4] updating token insert syntax --- .github/workflows/pr-sh.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-sh.yaml b/.github/workflows/pr-sh.yaml index a04ff34..b49e925 100644 --- a/.github/workflows/pr-sh.yaml +++ b/.github/workflows/pr-sh.yaml @@ -78,30 +78,30 @@ jobs: run: vendor/bin/phpunit --testsuite="Services Tests" --coverage-clover=coverage-service.xml - name: Upload Service coverage report #step 3 - run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev -F service -f coverage-service.xml + run: ./codecov -t ${{ secrets.CODECOV_SH_TOKEN }} --url https://publicqa.codecov.dev -F service -f coverage-service.xml - name: Run Controller Testsuite with Coverage run: vendor/bin/phpunit --testsuite="Controllers Tests" --coverage-clover=coverage-controller.xml - name: Upload Controller coverage report - run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev -F controller -f coverage-controller.xml + run: ./codecov -t ${{ secrets.CODECOV_SH_TOKEN }} --url https://publicqa.codecov.dev -F controller -f coverage-controller.xml - name: Run Unit Testsuite with Coverage run: vendor/bin/phpunit --testsuite="Unit Tests" --coverage-clover=coverage-unit.xml - name: Upload unit coverage report - run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev -F unit -f coverage-unit.xml + run: ./codecov -t ${{ secrets.CODECOV_SH_TOKEN }} --url https://publicqa.codecov.dev -F unit -f coverage-unit.xml - name: Run Complete Testsuite with Coverage run: vendor/bin/phpunit --coverage-clover=coverage.xml - name: Upload overall coverage report to another repo - run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev -F backend -f coverage.xml + run: ./codecov -t ${{ secrets.CODECOV_SH_TOKEN }} --url https://publicqa.codecov.dev -F backend -f coverage.xml - name: Javascript tests using Jest run: npm run test - name: Upload Javascript coverage - run: ./codecov -t ${CODECOV_SH_TOKEN} --url https://publicqa.codecov.dev -F javascript -f coverage/coverage-final.json + run: ./codecov -t ${{ secrets.CODECOV_SH_TOKEN }} --url https://publicqa.codecov.dev -F javascript -f coverage/coverage-final.json \ No newline at end of file