Use NodeJS 22 in GHA #84
This file contains 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: Lint themes | |
permissions: | |
contents: read | |
on: | |
push: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
branches: | |
- master | |
jobs: | |
test-php: | |
name: Test on php ${{ matrix.php-version }} and ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
php-version: ["7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"] | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use php ${{ matrix.php-version }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
- name: Lint PHP files | |
run: find . -name '*.php' -print0 | xargs -0 -r -n1 php -l | |
- name: Lint all themes | |
run: ./lint-theme.sh --all | |
css-check: | |
name: Check CSS files | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Get Yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- name: Cache Yarn dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install modules | |
run: yarn global add postcss postcss-cli autoprefixer --non-interactive | |
- name: Run postcss | |
# postcss also checks for syntax errors | |
run: postcss */css/*.css setup/styles.css --use autoprefixer --replace |