jenkins lint -> gitea workflow
This commit is contained in:
parent
ca86a0e239
commit
8e490af01c
|
@ -17,8 +17,28 @@ jobs:
|
|||
- name: checkout source
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: calculate cache key hash
|
||||
uses: actions/go-hashfiles@v0.0.1
|
||||
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 }}
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
pipeline {
|
||||
agent any
|
||||
|
||||
options {
|
||||
buildDiscarder(logRotator(numToKeepStr: '5'))
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('phpunit') {
|
||||
steps {
|
||||
sh """
|
||||
docker run --rm \
|
||||
--workdir /app \
|
||||
-v ${env.WORKSPACE}:/app \
|
||||
registry.fakecake.org/php:8.1-cli \
|
||||
php ./vendor/bin/phpunit
|
||||
"""
|
||||
}
|
||||
}
|
||||
stage('phpstan') {
|
||||
steps {
|
||||
sh """
|
||||
# php -d memory_limit=-1 ....
|
||||
docker run --rm \
|
||||
--workdir /app \
|
||||
-v ${env.WORKSPACE}:/app \
|
||||
registry.fakecake.org/php:8.1-cli \
|
||||
php -d memory_limit=-1 ./vendor/bin/phpstan --memory-limit=2G
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue