From 111723ac1c4daca99a11d6b9a45baa5beb424f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Fri, 28 Jan 2022 09:51:01 +0100 Subject: Update workflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- .github/workflows/dependabot-approve-merge.yml | 14 ++--- .github/workflows/lint-eslint.yml | 44 +++++++++++++++ .github/workflows/lint-php-cs.yml | 35 ++++++++++++ .github/workflows/lint-php.yml | 47 ++++++++++++++++ .github/workflows/lint-stylelint.yml | 44 +++++++++++++++ .github/workflows/lint.yml | 75 -------------------------- 6 files changed, 177 insertions(+), 82 deletions(-) create mode 100644 .github/workflows/lint-eslint.yml create mode 100644 .github/workflows/lint-php-cs.yml create mode 100644 .github/workflows/lint-php.yml create mode 100644 .github/workflows/lint-stylelint.yml delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/dependabot-approve-merge.yml b/.github/workflows/dependabot-approve-merge.yml index b56a1da..19a1311 100644 --- a/.github/workflows/dependabot-approve-merge.yml +++ b/.github/workflows/dependabot-approve-merge.yml @@ -7,23 +7,23 @@ name: Dependabot on: pull_request_target: - branches: + branches: - master - stable* jobs: - auto-merge: + auto-approve-merge: + if: github.actor == 'dependabot[bot]' runs-on: ubuntu-latest + steps: - # Default github action approve - - uses: hmarr/auto-approve-action@v2.0.0 - if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' + # Github actions bot approve + - uses: hmarr/auto-approve-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} # Nextcloud bot approve and merge request - - uses: ahmadnassri/action-dependabot-auto-merge@v1 - if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' + - uses: ahmadnassri/action-dependabot-auto-merge@v2 with: target: minor github-token: ${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }} diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml new file mode 100644 index 0000000..11590ff --- /dev/null +++ b/.github/workflows/lint-eslint.yml @@ -0,0 +1,44 @@ +# 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: + - master + - stable* + +jobs: + lint: + runs-on: ubuntu-latest + + name: eslint + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@v1.1 + id: versions + with: + fallbackNode: '^12' + fallbackNpm: '^6' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@v2 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml new file mode 100644 index 0000000..9aad514 --- /dev/null +++ b/.github/workflows/lint-php-cs.yml @@ -0,0 +1,35 @@ +# 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: + - master + - stable* + +jobs: + lint: + runs-on: ubuntu-latest + + name: php-cs + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v2 + with: + php-version: "7.4" + 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 ) diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml new file mode 100644 index 0000000..45493c3 --- /dev/null +++ b/.github/workflows/lint-php.yml @@ -0,0 +1,47 @@ +# 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: + - master + - stable* + +jobs: + php-lint: + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ["7.3", "7.4", "8.0"] + + name: php-lint + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - 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: + 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 diff --git a/.github/workflows/lint-stylelint.yml b/.github/workflows/lint-stylelint.yml new file mode 100644 index 0000000..64edcfb --- /dev/null +++ b/.github/workflows/lint-stylelint.yml @@ -0,0 +1,44 @@ +# 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: + - master + - stable* + +jobs: + lint: + runs-on: ubuntu-latest + + name: stylelint + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@v1.1 + id: versions + with: + fallbackNode: '^12' + fallbackNpm: '^6' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@v2 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run stylelint diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 67a6d3f..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Lint - -on: - pull_request: - push: - branches: - - master - - stable* - -jobs: - php: - runs-on: ubuntu-latest - - strategy: - matrix: - php-versions: ['7.3', '7.4'] - - name: php${{ matrix.php-versions }} - steps: - - uses: actions/checkout@v2 - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@v1 - with: - php-version: ${{ matrix.php-versions }} - coverage: none - - - name: Lint - run: composer run lint - - php-cs-fixer: - name: php-cs - runs-on: ubuntu-latest - - strategy: - matrix: - php-versions: ['7.4'] - - steps: - - name: Checkout - uses: actions/checkout@master - - - name: Set up php - uses: shivammathur/setup-php@master - with: - php-version: ${{ matrix.php-versions }} - coverage: none - - - name: Install dependencies - run: composer i - - - name: Run coding standards check - run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) - - node: - runs-on: ubuntu-latest - - strategy: - matrix: - node-versions: [12.x] - - name: node${{ matrix.node-versions }} - steps: - - uses: actions/checkout@v2 - - - name: Set up node ${{ matrix.node-versions }} - uses: actions/setup-node@v1 - with: - node-versions: ${{ matrix.node-versions }} - - - name: Install dependencies - run: npm ci - - - name: Lint - run: npm run lint -- cgit v1.2.3 From b165dae502aebd1ff8a384d01dccd292db012d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Fri, 28 Jan 2022 10:02:15 +0100 Subject: Create fixup.yml --- .github/workflows/fixup.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/fixup.yml diff --git a/.github/workflows/fixup.yml b/.github/workflows/fixup.yml new file mode 100644 index 0000000..6092cc3 --- /dev/null +++ b/.github/workflows/fixup.yml @@ -0,0 +1,20 @@ +# 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: Pull request checks + +on: pull_request + +jobs: + commit-message-check: + name: Block fixup and squash commits + + runs-on: ubuntu-latest + + steps: + - name: Run check + uses: xt0rted/block-autosquash-commits-action@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} -- cgit v1.2.3