diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml index 92073f5..59df546 100644 --- a/.github/actions/install/action.yml +++ b/.github/actions/install/action.yml @@ -12,47 +12,47 @@ inputs: runs: using: "composite" steps: - - name: Setup PHP ${{ inputs.php-version }} - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ inputs.php-version }} - tools: composer, ${{ inputs.php-tools }} + - name: Setup PHP ${{ inputs.php-version }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ inputs.php-version }} + tools: composer, ${{ inputs.php-tools }} - - name: Read Pico version - shell: bash - run: | - PICO_VERSION="$(php -r 'require("./lib/Pico.php"); echo Pico::VERSION;')" - echo "PICO_VERSION=$PICO_VERSION" | tee -a "$GITHUB_ENV" + - name: Read Pico version + shell: bash + run: | + PICO_VERSION="$(php -r 'require("./lib/Pico.php"); echo Pico::VERSION;')" + echo "PICO_VERSION=$PICO_VERSION" | tee -a "$GITHUB_ENV" - - name: Setup Composer - if: ${{ github.ref_type == 'branch' }} - shell: bash - run: | - COMPOSER_ROOT_VERSION= + - name: Setup Composer + if: ${{ github.ref_type == 'branch' }} + shell: bash + run: | + COMPOSER_ROOT_VERSION= - if [ -z "$(composer config extra.branch-alias."dev-$GITHUB_REF_NAME")" ]; then - COMPOSER_ROOT_VERSION="$(php -r " - require('./lib/Pico.php'); - echo preg_replace('/\.[0-9]+-dev$/', '.x-dev', Pico::VERSION); - ")" - echo "COMPOSER_ROOT_VERSION=$COMPOSER_ROOT_VERSION" | tee -a "$GITHUB_ENV" - fi + if [ -z "$(composer config extra.branch-alias."dev-$GITHUB_REF_NAME")" ]; then + COMPOSER_ROOT_VERSION="$(php -r " + require('./lib/Pico.php'); + echo preg_replace('/\.[0-9]+-dev$/', '.x-dev', Pico::VERSION); + ")" + echo "COMPOSER_ROOT_VERSION=$COMPOSER_ROOT_VERSION" | tee -a "$GITHUB_ENV" + fi - - name: Get Composer cache directory - shell: bash - run: | - COMPOSER_CACHE_DIR="$(composer config cache-dir)" - echo "COMPOSER_CACHE_DIR=$COMPOSER_CACHE_DIR" | tee -a "$GITHUB_ENV" + - name: Get Composer cache directory + shell: bash + run: | + COMPOSER_CACHE_DIR="$(composer config cache-dir)" + echo "COMPOSER_CACHE_DIR=$COMPOSER_CACHE_DIR" | tee -a "$GITHUB_ENV" - - name: Restore Composer cache - uses: actions/cache@v2 - with: - path: ${{ env.COMPOSER_CACHE_DIR }} - key: ${{ runner.os }}-composer-php${{ inputs.php-version }} - restore-keys: | - ${{ runner.os }}-composer- + - name: Restore Composer cache + uses: actions/cache@v2 + with: + path: ${{ env.COMPOSER_CACHE_DIR }} + key: ${{ runner.os }}-composer-php${{ inputs.php-version }} + restore-keys: | + ${{ runner.os }}-composer- - - name: Install Composer dependencies - shell: bash - run: | - composer install + - name: Install Composer dependencies + shell: bash + run: | + composer install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 97fde0e..23938b6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,15 +31,15 @@ jobs: PHP_VERSION: ${{ matrix.PHP_VERSION }} steps: - - name: Checkout repository - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v2 - - name: Install Pico CMS - uses: ./.github/actions/install - with: - php-version: ${{ env.PHP_VERSION }} - php-tools: phpcs + - name: Install Pico CMS + uses: ./.github/actions/install + with: + php-version: ${{ env.PHP_VERSION }} + php-tools: phpcs - - name: Run PHP_CodeSniffer - run: | - phpcs --standard=.phpcs.xml + - name: Run PHP_CodeSniffer + run: | + phpcs --standard=.phpcs.xml