Skip to content

Commit d121838

Browse files
authored
chore: switch to github actions for ci (#1745)
1 parent c969884 commit d121838

File tree

2 files changed

+84
-121
lines changed

2 files changed

+84
-121
lines changed

.github/workflows/ci.yml

Lines changed: 84 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,39 @@ on:
88
branches:
99
- '**'
1010

11+
env:
12+
PRIMARY_NODE_VERSION: 12
13+
1114
jobs:
1215
primary_code_validation_and_tests:
1316
name: Primary code validation and tests
1417
runs-on: ubuntu-latest
1518
steps:
1619
- uses: actions/checkout@v2
17-
- name: Use Node.js 12
20+
- name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }}
1821
uses: actions/setup-node@v1
1922
with:
20-
node-version: 12
23+
node-version: ${{ env.PRIMARY_NODE_VERSION }}
24+
25+
- name: Get yarn cache directory path
26+
id: yarn-cache-dir-path
27+
run: echo "::set-output name=dir::$(yarn cache dir)"
28+
29+
- uses: actions/cache@v1
30+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
31+
with:
32+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
33+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-yarn-
2136
2237
# This also runs a build as part of the postinstall bootstrap
23-
- name: install and build
38+
- name: Install dependencies and build
2439
run: |
2540
yarn --ignore-engines --frozen-lockfile
2641
yarn check-clean-workspace-after-install
2742
28-
# Note that this command *also* typechecks tests/tools,
43+
# Note that this command *also* type checks tests/tools,
2944
# whereas the build only checks src files
3045
- name: Typecheck all packages
3146
run: yarn typecheck
@@ -44,11 +59,6 @@ jobs:
4459
env:
4560
CI: true
4661

47-
- name: Run integrations tests
48-
run: yarn integration-tests
49-
env:
50-
CI: true
51-
5262
- name: Publish code coverage report
5363
uses: codecov/codecov-action@v1
5464
with:
@@ -57,6 +67,39 @@ jobs:
5767
flags: unittest
5868
name: codecov
5969

70+
integration_tests:
71+
name: Run integration tests on primary Node.js version
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v2
75+
- name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }}
76+
uses: actions/setup-node@v1
77+
with:
78+
node-version: ${{ env.PRIMARY_NODE_VERSION }}
79+
80+
- name: Get yarn cache directory path
81+
id: yarn-cache-dir-path
82+
run: echo "::set-output name=dir::$(yarn cache dir)"
83+
84+
- uses: actions/cache@v1
85+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
86+
with:
87+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
88+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
89+
restore-keys: |
90+
${{ runner.os }}-yarn-
91+
92+
# This also runs a build as part of the postinstall bootstrap
93+
- name: Install dependencies and build
94+
run: |
95+
yarn --ignore-engines --frozen-lockfile
96+
yarn check-clean-workspace-after-install
97+
98+
- name: Run integrations tests
99+
run: yarn integration-tests
100+
env:
101+
CI: true
102+
60103
unit_tests_on_other_node_versions:
61104
name: Run unit tests on other Node.js versions
62105
runs-on: ubuntu-latest
@@ -70,8 +113,20 @@ jobs:
70113
with:
71114
node-version: ${{ matrix.node-version }}
72115

116+
- name: Get yarn cache directory path
117+
id: yarn-cache-dir-path
118+
run: echo "::set-output name=dir::$(yarn cache dir)"
119+
120+
- uses: actions/cache@v1
121+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
122+
with:
123+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
124+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
125+
restore-keys: |
126+
${{ runner.os }}-yarn-
127+
73128
# This also runs a build as part of the postinstall bootstrap
74-
- name: install and build
129+
- name: Install dependencies and build
75130
run: |
76131
yarn --ignore-engines --frozen-lockfile
77132
yarn check-clean-workspace-after-install
@@ -88,19 +143,31 @@ jobs:
88143
if: github.event_name == 'push' && github.ref == 'refs/head/master'
89144
steps:
90145
- uses: actions/checkout@v1
91-
- name: Use Node.js 12
146+
- name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }}
92147
uses: actions/setup-node@v1
93148
with:
94-
node-version: 12
149+
node-version: ${{ env.PRIMARY_NODE_VERSION }}
95150
registry-url: https://registry.npmjs.org/
96151

152+
- name: Get yarn cache directory path
153+
id: yarn-cache-dir-path
154+
run: echo "::set-output name=dir::$(yarn cache dir)"
155+
156+
- uses: actions/cache@v1
157+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
158+
with:
159+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
160+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
161+
restore-keys: |
162+
${{ runner.os }}-yarn-
163+
97164
# This also runs a build as part of the postinstall bootstrap
98-
- name: install and build
165+
- name: Install dependencies and build
99166
run: |
100167
yarn --ignore-engines --frozen-lockfile
101168
yarn check-clean-workspace-after-install
102169
103-
# - name: Publish all packages to npm
104-
# run: npx lerna publish --canary --exact --force-publish --yes
105-
# env:
106-
# NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
170+
- name: Publish all packages to npm
171+
run: npx lerna publish --canary --exact --force-publish --yes
172+
env:
173+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

azure-pipelines.yml

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)