summaryrefslogtreecommitdiff
path: root/.gitea/workflows/lint.yaml
blob: 64be3efb81a315298afa556ba8272f3e35122a45 (plain)
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
51
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: lint

on:
  - push
  - workflow_dispatch
  - pull_request

defaults:
  run:
    shell: sh

jobs:
  lint:
    runs-on: alpine-3.16
    steps:
      - name: checkout source
        uses: actions/checkout@v3

      - name: npm install
        run: npm install

      - name: eslint
        run: npx eslint js plugins

      - name: calculate cache key hash
        uses: actions/[email protected]
        id: cache-hash
        with:
          patterns: |
            classes/*.php
            include/*.php
            plugins/**/*.php

      - name: phpunit
        run: php81 ./vendor/bin/phpunit

      - uses: https://github.com/actions/cache/restore@v3
        id: cache-phpstan
        with:
          path: /tmp/phpstan
          key: ${{ runner.os }}-phpstan-${{ steps.cache-hash.outputs.hash }}

      - name: phpstan
        run: php81 -d memory_limit=-1 ./vendor/bin/phpstan --memory-limit=2G

      - uses: https://github.com/actions/cache/save@v3
        with:
          path: /tmp/phpstan
          key: ${{ steps.cache-phpstan.outputs.cache-primary-key }}