summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-03-25 10:23:36 +0300
committerAndrew Dolgov <[email protected]>2023-03-25 10:58:02 +0300
commit8e490af01c446365b7d6e7168d7c2875ac31d5ee (patch)
tree4b5847faa86c0db3911bb7b4c436272ec2e58668
parentca86a0e23953fc0899117e46eca900eaba1a8a93 (diff)
jenkins lint -> gitea workflowlint-workflow
-rw-r--r--.gitea/workflows/lint.yaml20
-rw-r--r--Jenkinsfile33
2 files changed, 20 insertions, 33 deletions
diff --git a/.gitea/workflows/lint.yaml b/.gitea/workflows/lint.yaml
index 1e5b3ad3f..cb3122e39 100644
--- a/.gitea/workflows/lint.yaml
+++ b/.gitea/workflows/lint.yaml
@@ -17,8 +17,28 @@ jobs:
- name: checkout source
uses: actions/checkout@v3
+ - 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 }}
diff --git a/Jenkinsfile b/Jenkinsfile
deleted file mode 100644
index 778d80c5d..000000000
--- a/Jenkinsfile
+++ /dev/null
@@ -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
- """
- }
- }
- }
-}