diff --git a/.github/actions/composite/setup-composer-cache/action.yml b/.github/actions/composite/setup-composer-cache/action.yml new file mode 100644 index 0000000..1fdc649 --- /dev/null +++ b/.github/actions/composite/setup-composer-cache/action.yml @@ -0,0 +1,21 @@ +name: Set up Composer Cache +description: Set up Composer Cache + +runs: + using: composite + steps: + - name: Get composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + shell: bash + + - name: Cache Composer Files + uses: actions/cache@v4.0.0 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Composer install + run: composer install --prefer-dist --no-interaction --dev + shell: bash diff --git a/.github/workflows/bedrock-php.yml b/.github/workflows/bedrock-php.yml new file mode 100644 index 0000000..e0c07ac --- /dev/null +++ b/.github/workflows/bedrock-php.yml @@ -0,0 +1,66 @@ +name: Test Suite +on: + push: + branches: + - "**/*" + - "!main" +concurrency: + group: "${{ github.ref }}" + cancel-in-progress: true +env: + TRAVIS_COMMIT: ${{ github.sha }} + TRAVIS_BRANCH: ${{ github.ref }} +jobs: + PHP_Phan: + name: Phan + runs-on: ubuntu-20.04 + timeout-minutes: 15 + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + with: + # Set fetch-depth to 100 so that we can compare HEAD with a good chunk of git log history + fetch-depth: 100 + + # Run this after the packages are installed to ensure our apt-mirror is set up. + - name: Install PHP and Libraries + uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2.28.0 + with: + tools: composer:v2.7.1 + php-version: 8.1.28 + coverage: none + env: + GITHUB_TOKEN: ${{ secrets.CODE_EXPENSIFY_TOKEN }} + fail-fast: true + + - name: Setup Composer Cache + uses: ./.github/actions/composite/setup-composer-cache + + - name: Run Phan tests + run: "php ./ci/phan.php" + PHP_Style: + name: PHP Style + runs-on: ubuntu-20.04 + timeout-minutes: 15 + steps: + - name: checkout + uses: actions/checkout@v4.1.0 + with: + # Set fetch-depth to 100 so that we can compare HEAD with a good chunk of git log history + fetch-depth: 100 + + - name: Install PHP and Libraries + uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2.28.0 + with: + tools: composer:v2.7.1 + php-version: 8.1.28 + coverage: none + env: + GITHUB_TOKEN: ${{ secrets.CODE_EXPENSIFY_TOKEN }} + fail-fast: true + + - name: Setup Composer Cache + uses: ./.github/actions/composite/setup-composer-cache + + - name: Test for Style + run: "php ./ci/style.php" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 03633e7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: php -php: - - '8.1.28' - -before_install: - - cd ../ && composer self-update 2.7.1 && cd - - -install: - - pecl install ast-1.0.16 - - composer install --prefer-dist --no-interaction --dev - -script: - - ./ci/style.php - - ./ci/phan.php - -notifications: - email: - on_success: never - -sudo: false -dist: focal