-
Notifications
You must be signed in to change notification settings - Fork 67
50 lines (41 loc) · 1.45 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
ci:
runs-on: ubuntu-latest
strategy:
# set fail-fast to false prevent one matrix job from cancelling other matrix jobs
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast
fail-fast: false
matrix:
script: [ 'lint-md', 'lint-js', 'lint-php' ]
name: ${{ matrix.script }}
steps:
- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Read .nvmrc
id: read-nvm
run: |
NPM_VERSION=$(cat .nvmrc)
echo "version=$NPM_VERSION" >> $GITHUB_OUTPUT
- name: Install NPM
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version: ${{ steps.read-nvm.outputs.version }}
- name: Install yarn dependencies
run: |
npm install --global yarn
yarn install
- name: Install PHP
if: ${{ matrix.script == 'lint-php' }}
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2.22.0
with:
php-version: 8.1
- name: Install composer dependencies
if: ${{ matrix.script == 'lint-php' }}
run: composer install --prefer-dist --no-progress --ansi --no-interaction --optimize-autoloader
- name: Run lint
run: yarn ${{ matrix.script }}