diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2021-07-22 13:06:17 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2021-07-22 13:06:17 +0200 |
commit | 49b490ce6d1d726aa1c335b0b5c440d8a3cae5ff (patch) | |
tree | e3013292c32c7d7d12997a9e2c140b15f03a23ee /.github | |
parent | f14b8aa34bfb9f7af7b23cfecc09e2fb8f604c1b (diff) | |
download | nextcloud-server-49b490ce6d1d726aa1c335b0b5c440d8a3cae5ff.tar.gz nextcloud-server-49b490ce6d1d726aa1c335b0b5c440d8a3cae5ff.zip |
Migrate to npm 7
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/lint-eslint.yml | 44 | ||||
-rw-r--r-- | .github/workflows/lint.yml | 22 | ||||
-rw-r--r-- | .github/workflows/node.yml | 93 |
3 files changed, 77 insertions, 82 deletions
diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml new file mode 100644 index 00000000000..11590ffb04a --- /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.yml b/.github/workflows/lint.yml index 8fdd2948000..db6f9bbf40c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -40,25 +40,3 @@ jobs: composer run cs:check -- --format=checkstyle | cs2pr composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) shell: bash - - node: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [12.x] - - name: eslint node${{ matrix.node-version }} - steps: - - uses: actions/checkout@v2 - - - name: Set up node ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - - 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 dbb654070be..4b20eb5ed02 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: @@ -9,71 +14,39 @@ on: jobs: build: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [12.x] - + name: node steps: - - uses: actions/checkout@v2 - - name: Use node ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Install dependencies & build - run: | - make clean - npm ci - npm run build --if-present - - name: Check webpack build changes - run: | - bash -c "[[ ! \"`git status --porcelain `\" ]] || ( echo 'Uncommited changes in webpack build' && git status && exit 1 )" - env: - CI: true + - name: Checkout + uses: actions/checkout@v2 - test: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [12.x] - steps: - - uses: actions/checkout@v2 - - name: Use node ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Install dependencies - run: | - npm ci - - name: Test - run: npm run test - - jsunit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use node ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Test - run: ./autotest-js.sh + - 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' - handlebars: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [12.x] - steps: - - uses: actions/checkout@v2 - - name: Use 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 }} - - name: Install dependencies + 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 - - name: Run compile - run: ./build/compile-handlebars-templates.sh + 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 |