Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>pull/35911/head
parent
0558f4cb26
commit
0dc1aef292
@ -0,0 +1,37 @@ |
||||
# This workflow is provided via the organization template repository |
||||
# |
||||
# https://github.com/nextcloud/.github |
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization |
||||
|
||||
name: Lint |
||||
|
||||
on: pull_request |
||||
|
||||
permissions: |
||||
contents: read |
||||
|
||||
concurrency: |
||||
group: lint-php-cs-${{ github.head_ref || github.run_id }} |
||||
cancel-in-progress: true |
||||
|
||||
jobs: |
||||
lint: |
||||
runs-on: ubuntu-latest |
||||
|
||||
name: php-cs |
||||
|
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@v3 |
||||
|
||||
- name: Set up php |
||||
uses: shivammathur/setup-php@v2 |
||||
with: |
||||
php-version: "8.0" |
||||
coverage: none |
||||
|
||||
- name: Install dependencies |
||||
run: composer i |
||||
|
||||
- name: Lint |
||||
run: composer run cs:check || ( echo "Please run `composer run cs:fix` to format your code" && exit 1 ) |
@ -0,0 +1,57 @@ |
||||
# This workflow is provided via the organization template repository |
||||
# |
||||
# https://github.com/nextcloud/.github |
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization |
||||
|
||||
name: Lint |
||||
|
||||
on: |
||||
pull_request: |
||||
push: |
||||
branches: |
||||
- main |
||||
- master |
||||
- stable* |
||||
|
||||
permissions: |
||||
contents: read |
||||
|
||||
concurrency: |
||||
group: lint-php-${{ github.head_ref || github.run_id }} |
||||
cancel-in-progress: true |
||||
|
||||
jobs: |
||||
php-lint: |
||||
runs-on: ubuntu-latest |
||||
strategy: |
||||
matrix: |
||||
php-versions: ["8.0", "8.1", "8.2"] |
||||
|
||||
name: php-lint |
||||
|
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@v3 |
||||
|
||||
- name: Set up php ${{ matrix.php-versions }} |
||||
uses: shivammathur/setup-php@v2 |
||||
with: |
||||
php-version: ${{ matrix.php-versions }} |
||||
coverage: none |
||||
|
||||
- name: Lint |
||||
run: composer run lint |
||||
|
||||
summary: |
||||
permissions: |
||||
contents: none |
||||
runs-on: ubuntu-latest |
||||
needs: php-lint |
||||
|
||||
if: always() |
||||
|
||||
name: php-lint-summary |
||||
|
||||
steps: |
||||
- name: Summary status |
||||
run: if ${{ needs.php-lint.result != "success" && needs.php-lint.result != "skipped" }}; then exit 1; fi |
@ -1,42 +0,0 @@ |
||||
name: Lint |
||||
on: pull_request |
||||
|
||||
jobs: |
||||
php-linters: |
||||
runs-on: ubuntu-latest |
||||
strategy: |
||||
matrix: |
||||
php-versions: ['7.4', '8.0', '8.1', '8.2'] |
||||
name: php${{ matrix.php-versions }} lint |
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@master |
||||
- name: Set up php${{ matrix.php-versions }} |
||||
uses: shivammathur/setup-php@master |
||||
with: |
||||
php-version: ${{ matrix.php-versions }} |
||||
extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip |
||||
coverage: none |
||||
- name: Lint |
||||
run: composer run lint |
||||
|
||||
php-cs-fixer: |
||||
name: php-cs check |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@master |
||||
- name: Set up php |
||||
uses: shivammathur/setup-php@master |
||||
with: |
||||
php-version: 7.4 |
||||
extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip |
||||
coverage: none |
||||
tools: cs2pr |
||||
- name: Install dependencies |
||||
run: composer i |
||||
- name: Run coding standards check |
||||
run: | |
||||
composer run cs:check -- --format=checkstyle | cs2pr |
||||
composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) |
||||
shell: bash |
@ -1,56 +1,61 @@ |
||||
name: Static code analysis |
||||
|
||||
on: [pull_request] |
||||
on: |
||||
pull_request: |
||||
|
||||
jobs: |
||||
static-code-analysis: |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- uses: actions/checkout@v2 |
||||
- name: Checkout submodules |
||||
shell: bash |
||||
run: | |
||||
auth_header="$(git config --local --get http.https://github.com/.extraheader)" |
||||
git submodule sync --recursive |
||||
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 |
||||
- name: Set up php7.4 |
||||
uses: shivammathur/setup-php@master |
||||
with: |
||||
php-version: 7.4 |
||||
extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip |
||||
coverage: none |
||||
- name: Composer install |
||||
run: composer i |
||||
- name: Psalm |
||||
run: composer run psalm -- --monochrome --no-progress --output-format=github --update-baseline || ( git diff -- . ':!lib/composer' && exit 1 ) |
||||
- name: Check diff |
||||
run: git diff -- . ':!lib/composer' |
||||
- name: Show potential changes in Psalm baseline |
||||
run: | |
||||
bash -c "[[ ! \"`git status --porcelain build/psalm-baseline.xml`\" ]] || ( echo 'Uncommited changes in Psalm baseline' && git status && git diff build/psalm-baseline.xml)" |
||||
|
||||
static-code-analysis-ocp: |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- uses: actions/checkout@v2 |
||||
- name: Checkout submodules |
||||
shell: bash |
||||
run: | |
||||
auth_header="$(git config --local --get http.https://github.com/.extraheader)" |
||||
git submodule sync --recursive |
||||
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 |
||||
- name: Set up php7.4 |
||||
uses: shivammathur/setup-php@master |
||||
with: |
||||
php-version: 7.4 |
||||
extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip |
||||
coverage: none |
||||
- name: Composer install |
||||
run: composer i |
||||
- name: Psalm |
||||
run: composer run psalm -- -c psalm-ocp.xml --monochrome --no-progress --output-format=github --update-baseline || ( git diff -- . ':!lib/composer' && exit 1 ) |
||||
- name: Check diff |
||||
run: git diff -- . ':!lib/composer' |
||||
- name: Show potential changes in Psalm baseline |
||||
run: | |
||||
bash -c "[[ ! \"`git status --porcelain build/psalm-baseline-ocp.xml`\" ]] || ( echo 'Uncommited changes in Psalm baseline' && git status && git diff build/psalm-baseline.xml)" |
||||
static-code-analysis: |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@v3 |
||||
with: |
||||
submodules: true |
||||
|
||||
- name: Set up php |
||||
uses: shivammathur/setup-php@v2 |
||||
with: |
||||
php-version: '8.0' |
||||
extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip |
||||
coverage: none |
||||
|
||||
- name: Composer install |
||||
run: composer i |
||||
|
||||
- name: Psalm |
||||
run: composer run psalm -- --monochrome --no-progress --output-format=github --update-baseline || ( git diff -- . ':!lib/composer' && exit 1 ) |
||||
|
||||
- name: Check diff |
||||
run: git diff -- . ':!lib/composer' |
||||
|
||||
- name: Show potential changes in Psalm baseline |
||||
run: | |
||||
bash -c "[[ ! \"`git status --porcelain build/psalm-baseline.xml`\" ]] || ( echo 'Uncommited changes in Psalm baseline' && git status && git diff build/psalm-baseline.xml)" |
||||
|
||||
static-code-analysis-ocp: |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout |
||||
uses: actions/checkout@v3 |
||||
with: |
||||
submodules: true |
||||
|
||||
- name: Set up php |
||||
uses: shivammathur/setup-php@v2 |
||||
with: |
||||
php-version: '8.0' |
||||
extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip |
||||
coverage: none |
||||
|
||||
- name: Composer install |
||||
run: composer i |
||||
|
||||
- name: Psalm |
||||
run: composer run psalm -- -c psalm-ocp.xml --monochrome --no-progress --output-format=github --update-baseline || ( git diff -- . ':!lib/composer' && exit 1 ) |
||||
|
||||
- name: Check diff |
||||
run: git diff -- . ':!lib/composer' |
||||
|
||||
- name: Show potential changes in Psalm baseline |
||||
run: | |
||||
bash -c "[[ ! \"`git status --porcelain build/psalm-baseline-ocp.xml`\" ]] || ( echo 'Uncommited changes in Psalm baseline' && git status && git diff build/psalm-baseline.xml)" |
||||
|
Loading…
Reference in new issue