ci: Replace shivammathur/setup-php with direct apt commands (#523) #87
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: ci | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - "**" | |
| jobs: | |
| check-lock-file-version: | |
| name: NPM Lock File Version | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-20.04 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Check NPM lock file version | |
| run: | | |
| version=$(node -e "console.log(require('./package-lock.json').lockfileVersion)") | |
| if [ "$version" != "2" ]; then | |
| echo "::error::Expected lockfileVersion 2, got $version" | |
| exit 1 | |
| fi | |
| build: | |
| runs-on: ubuntu-20.04 | |
| timeout-minutes: 30 | |
| strategy: | |
| matrix: | |
| include: | |
| - name: PHP 8.3 | |
| PHP_VERSION: 8.3 | |
| - name: PHP 8.2 | |
| PHP_VERSION: 8.2 | |
| - name: PHP 8.1 | |
| PHP_VERSION: 8.1 | |
| fail-fast: false | |
| name: Test ${{ matrix.name }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 16.17.1 | |
| cache: npm | |
| - name: Setup PHP ${{ matrix.PHP_VERSION }} | |
| run: | | |
| sudo add-apt-repository ppa:ondrej/php -y | |
| sudo apt-get update -y | |
| sudo apt-get install -y php${{ matrix.PHP_VERSION }} php${{ matrix.PHP_VERSION }}-mbstring php${{ matrix.PHP_VERSION }}-xml php${{ matrix.PHP_VERSION }}-curl | |
| sudo update-alternatives --set php /usr/bin/php${{ matrix.PHP_VERSION }} | |
| php --version | |
| - run: composer install | |
| - run: npm ci | |
| - run: npm start | |
| - run: npm run lint | |
| - run: npm run test-stream | |
| - run: npm run test:coverage | |
| - run: npm run document-check | |
| - run: npm run document | |
| env: | |
| CI: true | |
| - run: bash <(curl -s https://codecov.io/bash) | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true |