Skip to content

Bring local-setup into the V2 era #700

Bring local-setup into the V2 era

Bring local-setup into the V2 era #700

Workflow file for this run

name: common.js
on:
push:
branches:
- main
paths:
- "common.js/**"
pull_request:
workflow_dispatch:
defaults:
run:
working-directory: common.js
jobs:
common-js-detect-changes:
runs-on: ubuntu-latest
outputs:
path-filter: ${{ steps.filter.outputs.path-filter }}
steps:
- uses: actions/checkout@v2
if: github.event_name == 'pull_request'
- uses: dorny/paths-filter@v2
if: github.event_name == 'pull_request'
id: filter
with:
filters: |
path-filter:
- './common.js/**'
common-js-test:
needs: common-js-detect-changes
if: |
github.event_name != 'pull_request'
|| needs.common-js-detect-changes.outputs.path-filter == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "12.x"
- name: Install dependencies
run: yarn install
- name: Run tests
run: yarn test
common-js-lint:
needs: common-js-detect-changes
if: |
(github.event_name != 'pull_request'
&& github.event_name != 'schedule')
|| needs.common-js-detect-changes.outputs.path-filter == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "12.x"
- name: Install dependencies
run: yarn install
- name: Lint
run: yarn run lint
# Publishing of the common.js package has been switched off due to problems
# with package versioning. Below configuration can succesfully publish the
# package, but commiting of the information about bumped-up version to the Git
# repository doesn't work - commiter's user name and e-mail are required.
# Without this update of the version info, next runs of the common-js-publish
# generate the same version of package as before, and upload is not accepted.
# We may want to resolve that in the future.
# common-js-publish:
# needs: [common-js-test, common-js-lint]
# if:
# github.ref == 'refs/heads/main'
# && github.event_name != 'pull_request'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
# with:
# node-version: "12.x"
# - name: Install dependencies
# run: yarn install
# - name: Publish to npm
# env:
# NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: yarn publish --prerelease --access public