diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2022-01-28 12:19:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-28 12:19:12 +0300 |
commit | 4e417b9a2a496b73432f4659b21cf156f1d4a64e (patch) | |
tree | 3447aebede483c2fe7adc1bd9cf56cc9e7a0a4bd | |
parent | 5766f5ef0995948f81f9b0358f2b8ab8c0fee28a (diff) | |
parent | 1150cdbe518efa7dcd2094401e9a4b2150d26884 (diff) |
Merge pull request #691 from nextcloud/feat/workflows-stable22v22.2.5rc1v22.2.5
-rw-r--r-- | .github/workflows/dependabot-approve-merge.yml | 26 | ||||
-rw-r--r-- | .github/workflows/fixup.yml | 20 | ||||
-rw-r--r-- | .github/workflows/lint-eslint.yml | 44 | ||||
-rw-r--r-- | .github/workflows/lint-php-cs.yml | 35 | ||||
-rw-r--r-- | .github/workflows/lint-php.yml | 47 | ||||
-rw-r--r-- | .github/workflows/lint-stylelint.yml | 44 | ||||
-rw-r--r-- | .github/workflows/lint.yml | 75 | ||||
-rw-r--r-- | .github/workflows/node.yml | 38 |
8 files changed, 236 insertions, 93 deletions
diff --git a/.github/workflows/dependabot-approve-merge.yml b/.github/workflows/dependabot-approve-merge.yml index 201d7f5..19a1311 100644 --- a/.github/workflows/dependabot-approve-merge.yml +++ b/.github/workflows/dependabot-approve-merge.yml @@ -1,19 +1,29 @@ +# 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: Dependabot -on: pull_request + +on: + pull_request_target: + 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: patch + target: minor github-token: ${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }} 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 }} 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 diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index a971a7e..4b20eb5 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -1,3 +1,8 @@ +# 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: Node on: @@ -11,18 +16,25 @@ jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [12.x] - - name: node${{ matrix.node-version }} + name: node steps: - - uses: actions/checkout@v2 + - 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 ${{ matrix.node-version }} - uses: actions/setup-node@v1 + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@v2 with: - node-version: ${{ matrix.node-version }} + 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 & build run: | @@ -31,4 +43,10 @@ jobs: - name: Check webpack build changes run: | - bash -c "[[ ! \"`git status --porcelain `\" ]] || ( echo 'Uncommited changes in webpack build' && git status && exit 1 )" + bash -c "[[ ! \"`git status --porcelain `\" ]] || exit 1" + + - name: Show changes on failure + if: failure() + run: | + git status + git --no-pager diff |