diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index aa99038..dfa1b7d 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -29,35 +29,25 @@ jobs: EXTENSION_PATH: "my-code/common" steps: - - name: Clone DDEV files - uses: actions/checkout@v3 - with: - path: .ddev - repository: julienloizelet/ddev-php - ref: "main" - name: Install DDEV - env: - DDEV_VERSION: v1.21.4 run: | # @see https://ddev.readthedocs.io/en/stable/#installationupgrade-script-linux-and-macos-armarm64-and-amd64-architectures - sudo apt-get -qq update - sudo apt-get -qq -y install libnss3-tools - curl -LO https://raw.githubusercontent.com/drud/ddev/master/scripts/install_ddev.sh - bash install_ddev.sh ${{env.DDEV_VERSION}} + curl -fsSL https://apt.fury.io/drud/gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/ddev.gpg > /dev/null + echo "deb [signed-by=/etc/apt/trusted.gpg.d/ddev.gpg] https://apt.fury.io/drud/ * *" | sudo tee /etc/apt/sources.list.d/ddev.list + sudo apt-get -q update + sudo apt-get -q -y install libnss3-tools ddev + mkcert -install ddev config global --instrumentation-opt-in=false --omit-containers=dba,ddev-ssh-agent - rm install_ddev.sh - - name: Set PHP_VERSION_CODE env - # used in some directory path and conventional file naming - # Example : 7.4 => php74 - run: | - echo "PHP_VERSION_CODE=$(echo php${{ matrix.php-version }} | sed 's/\.//g' )" >> $GITHUB_ENV + - name: Create empty PHP DDEV project + run: ddev config --project-type=php --project-name=crowdsec-php-common --php-version=${{ matrix.php-version }} + + - name: Add-ons install + run: ddev get julienloizelet/ddev-tools - name: Start DDEV with PHP ${{ matrix.php-version }} - run: | - cp .ddev/config_overrides/config.${{ env.PHP_VERSION_CODE }}.yaml .ddev/config.${{ env.PHP_VERSION_CODE }}.yaml - ddev start + run: ddev start - name: Some DEBUG information run: | @@ -95,4 +85,4 @@ jobs: run: | ddev xdebug ddev php -dxdebug.mode=coverage ./${{env.EXTENSION_PATH}}/tools/coding-standards/vendor/bin/phpunit --configuration ./${{env.EXTENSION_PATH}}/tools/coding-standards/phpunit/phpunit.xml --coverage-text=./${{env.EXTENSION_PATH}}/coding-standards/phpunit/code-coverage/report.txt - cat ${{env.EXTENSION_PATH}}/coding-standards/phpunit/code-coverage/report.txt \ No newline at end of file + cat ${{env.EXTENSION_PATH}}/coding-standards/phpunit/code-coverage/report.txt diff --git a/.github/workflows/unit-and-integration-test.yml b/.github/workflows/unit-and-integration-test.yml index d2c0a8d..fbc05a8 100644 --- a/.github/workflows/unit-and-integration-test.yml +++ b/.github/workflows/unit-and-integration-test.yml @@ -33,35 +33,24 @@ jobs: EXTENSION_PATH: "my-code/common" steps: - - name: Clone DDEV files - uses: actions/checkout@v3 - with: - path: .ddev - repository: julienloizelet/ddev-php - ref: "main" - - name: Install DDEV - env: - DDEV_VERSION: v1.21.4 run: | # @see https://ddev.readthedocs.io/en/stable/#installationupgrade-script-linux-and-macos-armarm64-and-amd64-architectures - sudo apt-get -qq update - sudo apt-get -qq -y install libnss3-tools - curl -LO https://raw.githubusercontent.com/drud/ddev/master/scripts/install_ddev.sh - bash install_ddev.sh ${{env.DDEV_VERSION}} + curl -fsSL https://apt.fury.io/drud/gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/ddev.gpg > /dev/null + echo "deb [signed-by=/etc/apt/trusted.gpg.d/ddev.gpg] https://apt.fury.io/drud/ * *" | sudo tee /etc/apt/sources.list.d/ddev.list + sudo apt-get -q update + sudo apt-get -q -y install libnss3-tools ddev + mkcert -install ddev config global --instrumentation-opt-in=false --omit-containers=dba,ddev-ssh-agent - rm install_ddev.sh - - name: Set PHP_VERSION_CODE env - # used in some directory path and conventional file naming - # Example : 7.4 => 74 - run: | - echo "PHP_VERSION_CODE=$(echo php${{ matrix.php-version }} | sed 's/\.//g' )" >> $GITHUB_ENV + - name: Create empty PHP DDEV project + run: ddev config --project-type=php --project-name=crowdsec-php-common --php-version=${{ matrix.php-version }} + + - name: Add-ons install + run: ddev get julienloizelet/ddev-tools - name: Start DDEV with PHP ${{ matrix.php-version }} - run: | - cp .ddev/config_overrides/config.${{ env.PHP_VERSION_CODE }}.yaml .ddev/config.${{ env.PHP_VERSION_CODE }}.yaml - ddev start + run: ddev start - name: Some DEBUG information run: |