-
Notifications
You must be signed in to change notification settings - Fork 16
97 lines (82 loc) · 2.55 KB
/
common-js.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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