From be307c97d5ae259efec2d7c37a492bcf5734a6af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Sun, 16 Jan 2022 11:28:30 +0100 Subject: [PATCH] Update workflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- .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 | 95 ---------------------------- 5 files changed, 170 insertions(+), 95 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/lint-eslint.yml b/.github/workflows/lint-eslint.yml new file mode 100644 index 000000000..11590ffb0 --- /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 000000000..9aad51409 --- /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 000000000..45493c345 --- /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 000000000..64edcfba5 --- /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 fcd068a35..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,95 +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', '8.0'] - - name: php${{ matrix.php-versions }} - steps: - - 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 - - php-cs-fixer: - runs-on: ubuntu-latest - - strategy: - matrix: - php-versions: ['7.4'] - - name: cs php${{ matrix.php-versions }} - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up php - uses: shivammathur/setup-php@v2 - 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 - - name: eslint node - steps: - - uses: actions/checkout@v2 - - - name: Set up node - uses: actions/setup-node@v2 - with: - node-version: 14 - - - name: Set up npm7 - run: npm i -g npm@7 - - - name: Install dependencies - run: npm ci - - - name: Lint - run: npm run lint - - stylelint: - runs-on: ubuntu-latest - - name: stylelint node - steps: - - uses: actions/checkout@v2 - - - name: Set up node - uses: actions/setup-node@v2 - with: - node-version: 14 - - - name: Set up npm7 - run: npm i -g npm@7 - - - name: Install dependencies - run: npm ci - - - name: Lint - run: npm run stylelint