diff options
author | Julius Härtl <jus@bitgrid.net> | 2021-06-28 09:50:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-28 09:50:13 +0300 |
commit | 0fdc8edbba61202747d066182745988c54196b59 (patch) | |
tree | a9d3d3bf78b5febbf77f793652d5d59ee8865348 /.github | |
parent | a454879a4b8976fc2940d3a8a76202b4b23906e1 (diff) | |
parent | 51b1dd0491347e10c0ce1b1491fd328d774a6946 (diff) |
Merge pull request #1688 from nextcloud/feat/node-template
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/node.yml | 46 | ||||
-rw-r--r-- | .github/workflows/nodejs.yml | 33 |
2 files changed, 46 insertions, 33 deletions
diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml new file mode 100644 index 000000000..aebed2cbb --- /dev/null +++ b/.github/workflows/node.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: Node + +on: + pull_request: + push: + branches: + - master + - stable* + +jobs: + build: + runs-on: ubuntu-latest + + name: node + 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: package-engines-versions + with: + fallbackNode: '^12' + fallbackNpm: '^6' + + - name: Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }} + uses: actions/setup-node@v2 + with: + node-version: ${{ steps.package-engines-versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.package-engines-versions.outputs.npmVersion }} + run: npm i -g npm@"${{ steps.package-engines-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 `\" ]] || ( echo 'Uncommited changes in webpack build' && git status && exit 1 )" diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml deleted file mode 100644 index dd259ace2..000000000 --- a/.github/workflows/nodejs.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Node CI - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [14.x] - - steps: - - uses: actions/checkout@v1 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Set up npm7 - run: npm i -g npm@7 - - name: npm install, build - run: | - npm ci - npm run build --if-present - - name: npm test - run: | - npm test - - name: check webpack build - run: | - bash -c "[[ ! \"`git status --porcelain `\" ]] || ( echo 'Uncommited changes in webpack build' && git status && exit 1 )" - env: - CI: true |