diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2022-04-14 12:42:08 +0300 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2022-04-14 12:50:30 +0300 |
commit | fb06f34c3aaecb5949edf5dfa4e4e4f7470f6b6b (patch) | |
tree | 269bfd29669140cefef58a8164e1781e6de2a87c | |
parent | a8be9d5dac3e5dd16674b2be80839b2c1ad9f6d9 (diff) |
Update workflows
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
-rw-r--r-- | .github/workflows/command-rebase.yml | 46 | ||||
-rw-r--r-- | .github/workflows/dependabot-approve-merge.yml | 30 | ||||
-rw-r--r-- | .github/workflows/fixup.yml | 20 | ||||
-rw-r--r-- | .github/workflows/lint-eslint.yml | 45 | ||||
-rw-r--r-- | .github/workflows/lint-info-xml.yml | 32 | ||||
-rw-r--r-- | .github/workflows/lint-php-cs.yml | 36 | ||||
-rw-r--r-- | .github/workflows/lint-php.yml | 48 | ||||
-rw-r--r-- | .github/workflows/lint-stylelint.yml | 45 | ||||
-rw-r--r-- | .github/workflows/lint.yml | 65 | ||||
-rw-r--r-- | .github/workflows/node.yml | 53 | ||||
-rw-r--r-- | .github/workflows/test.yml | 16 |
11 files changed, 355 insertions, 81 deletions
diff --git a/.github/workflows/command-rebase.yml b/.github/workflows/command-rebase.yml new file mode 100644 index 0000000..4e41c31 --- /dev/null +++ b/.github/workflows/command-rebase.yml @@ -0,0 +1,46 @@ +# 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: Rebase command + +on: + issue_comment: + types: created + +jobs: + rebase: + runs-on: ubuntu-latest + + # On pull requests and if the comment starts with `/rebase` + if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/rebase') + + steps: + - name: Add reaction on start + uses: peter-evans/create-or-update-comment@v2 + with: + token: ${{ secrets.COMMAND_BOT_PAT }} + repository: ${{ github.event.repository.full_name }} + comment-id: ${{ github.event.comment.id }} + reaction-type: "+1" + + - name: Checkout the latest code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + token: ${{ secrets.COMMAND_BOT_PAT }} + + - name: Automatic Rebase + uses: cirrus-actions/rebase@1.5 + env: + GITHUB_TOKEN: ${{ secrets.COMMAND_BOT_PAT }} + + - name: Add reaction on failure + uses: peter-evans/create-or-update-comment@v2 + if: failure() + with: + token: ${{ secrets.COMMAND_BOT_PAT }} + repository: ${{ github.event.repository.full_name }} + comment-id: ${{ github.event.comment.id }} + reaction-type: "-1" diff --git a/.github/workflows/dependabot-approve-merge.yml b/.github/workflows/dependabot-approve-merge.yml new file mode 100644 index 0000000..e0e6bfa --- /dev/null +++ b/.github/workflows/dependabot-approve-merge.yml @@ -0,0 +1,30 @@ +# 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_target: + branches: + - main + - master + - stable* + +jobs: + auto-approve-merge: + if: github.actor == 'dependabot[bot]' + runs-on: ubuntu-latest + + steps: + # 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@v2 + with: + 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..5f48fb5 --- /dev/null +++ b/.github/workflows/lint-eslint.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: Lint + +on: + pull_request: + push: + branches: + - main + - master + - stable* + +jobs: + lint: + runs-on: ubuntu-latest + + name: eslint + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@v1.2 + id: versions + with: + fallbackNode: '^12' + fallbackNpm: '^6' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@v3 + 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-info-xml.yml b/.github/workflows/lint-info-xml.yml new file mode 100644 index 0000000..d877ee5 --- /dev/null +++ b/.github/workflows/lint-info-xml.yml @@ -0,0 +1,32 @@ +# 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* + +jobs: + xml-linters: + runs-on: ubuntu-latest + + name: info.xml lint + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Download schema + run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd + + - name: Lint info.xml + uses: ChristophWurst/xmllint-action@v1 + with: + xml-file: ./appinfo/info.xml + xml-schema-file: ./info.xsd diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml new file mode 100644 index 0000000..049fb19 --- /dev/null +++ b/.github/workflows/lint-php-cs.yml @@ -0,0 +1,36 @@ +# 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* + +jobs: + lint: + runs-on: ubuntu-latest + + name: php-cs + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - 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..a4abc44 --- /dev/null +++ b/.github/workflows/lint-php.yml @@ -0,0 +1,48 @@ +# 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* + +jobs: + php-lint: + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ["7.4", "8.0"] + + 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: + 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..407f870 --- /dev/null +++ b/.github/workflows/lint-stylelint.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: Lint + +on: + pull_request: + push: + branches: + - main + - master + - stable* + +jobs: + lint: + runs-on: ubuntu-latest + + name: stylelint + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@v1.2 + id: versions + with: + fallbackNode: '^12' + fallbackNpm: '^6' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@v3 + 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 e96ba29..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Lint -on: push - -jobs: - xml-linters: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@master - - name: Download schema - run: wget https://apps.nextcloud.com/schema/apps/info.xsd - - name: Lint info.xml - uses: ChristophWurst/xmllint-action@v1 - with: - xml-file: ./appinfo/info.xml - xml-schema-file: ./info.xsd - - php-linters: - runs-on: ubuntu-latest - strategy: - matrix: - php-versions: [ 7.3, 7.4, 8.0 ] - 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 }} - 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 - coverage: none - - name: Install dependencies - run: composer i - - name: Run coding standards check - run: composer run cs:check - - node-linters: - runs-on: ubuntu-latest - name: ESLint - steps: - - uses: actions/checkout@master - - name: Set up Node - uses: actions/setup-node@v1 - with: - node-version: 14.x - - name: npm install - run: npm ci - - name: eslint - run: npm run lint - env: - CI: true diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml new file mode 100644 index 0000000..bb3bbf5 --- /dev/null +++ b/.github/workflows/node.yml @@ -0,0 +1,53 @@ +# 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: + pull_request: + push: + branches: + - main + - master + - stable* + +jobs: + build: + runs-on: ubuntu-latest + + name: node + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@v1.2 + id: versions + with: + fallbackNode: '^12' + fallbackNpm: '^6' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@v3 + 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 & build + run: | + npm ci + npm run build --if-present + + - name: Check webpack build changes + run: | + bash -c "[[ ! \"`git status --porcelain `\" ]] || exit 1" + + - name: Show changes on failure + if: failure() + run: | + git status + git --no-pager diff diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 25c57ae..499ff53 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -116,19 +116,3 @@ jobs: env: CI: true TRAVIS: true - - frontend-unit-test: - runs-on: ubuntu-latest - name: Front-end unit tests - steps: - - uses: actions/checkout@master - - name: Set up Node - uses: actions/setup-node@v1 - with: - node-version: 14.x - - name: npm install - run: npm install - - name: run tests - run: npm run test - env: - CI: true |