From 3c44ac2ca388223cc1cc349884666df0af21e87a Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Fri, 27 Oct 2023 13:53:23 +0200 Subject: [PATCH] ci(psalm): replace custom static analysis with org template Signed-off-by: Richard Steinmetz --- .github/workflows/psalm.yml | 45 +++++++++++++++++++++++++++ .github/workflows/static-analysis.yml | 43 ------------------------- 2 files changed, 45 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/psalm.yml delete mode 100644 .github/workflows/static-analysis.yml diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml new file mode 100644 index 00000000..cec9a937 --- /dev/null +++ b/.github/workflows/psalm.yml @@ -0,0 +1,45 @@ +# 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: Static analysis + +on: + pull_request: + push: + branches: + - master + - main + - stable* + +concurrency: + group: psalm-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + static-analysis: + runs-on: ubuntu-latest + + name: Nextcloud + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Set up php + uses: shivammathur/setup-php@7fdd3ece872ec7ec4c098ae5ab7637d5e0a96067 # v2 + with: + php-version: 8.1 + coverage: none + ini-file: development + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Install dependencies + run: composer i + + - name: Install nextcloud/ocp + run: composer require --dev nextcloud/ocp:dev-stable26 --ignore-platform-reqs --with-dependencies + + - name: Run coding standards check + run: composer run psalm diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml deleted file mode 100644 index 0acb56ec..00000000 --- a/.github/workflows/static-analysis.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Static analysis - -on: - pull_request: - push: - branches: - - main - - master - - stable* - -jobs: - static-psalm-analysis: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - ocp-version: [ 'dev-stable24', 'dev-stable25', 'dev-stable26', 'dev-master' ] - - name: Nextcloud ${{ matrix.ocp-version }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up php - uses: shivammathur/setup-php@v2 - with: - php-version: 7.4 - coverage: none - - - name: Install dependencies - run: composer i - - - name: Install OCP package - if: ${{ matrix.ocp-version != 'dev-master' }} - run: composer require --dev christophwurst/nextcloud:${{ matrix.ocp-version }} - - - name: Install OCP package - if: ${{ matrix.ocp-version == 'dev-master' }} - run: composer require --dev christophwurst/nextcloud:${{ matrix.ocp-version }} --ignore-platform-req=php - - - name: Run coding standards check - run: composer run psalm