Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit e1c20ed

Browse files
authored
chore: use github actions for CI runs (#905)
1 parent 9bd4f11 commit e1c20ed

File tree

2 files changed

+48
-57
lines changed

2 files changed

+48
-57
lines changed

.circleci/config.yml

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -8,69 +8,13 @@ workflows:
88
version: 2
99
tests:
1010
jobs:
11-
# Separate node8 from others to ignore any packages that no longer
12-
# support node8
13-
- unit_tests:
14-
name: node8
15-
filters: *release_tags
16-
node_version: 8
17-
npm_script_extra_args: --ignore @opencensus/exporter-stackdriver
18-
- unit_tests:
19-
name: node<< matrix.node_version >>
20-
filters: *release_tags
21-
matrix:
22-
parameters:
23-
node_version: [10, 11, 12]
2411
- publish_npm:
25-
requires:
26-
- node8
27-
- node10
28-
- node11
29-
- node12
3012
filters:
3113
branches:
3214
ignore: /.*/
3315
<<: *release_tags
3416

3517
jobs:
36-
unit_tests:
37-
docker:
38-
- image: node:<< parameters.node_version >>
39-
user: node
40-
environment:
41-
OPENCENSUS_MONGODB_TESTS: 1
42-
OPENCENSUS_REDIS_TESTS: 1
43-
- mongo_service:
44-
image: mongo
45-
- redis_service:
46-
image: redis
47-
parameters:
48-
node_version:
49-
description: The node version to run the tests with
50-
type: integer
51-
npm_script_extra_args:
52-
description: Extra arguments passed to npm scripts
53-
type: string
54-
default: ""
55-
steps:
56-
- checkout
57-
- run:
58-
name: Install modules and dependencies.
59-
command: npm install
60-
- run:
61-
name: Check code style and linting
62-
command: npm run check -- << parameters.npm_script_extra_args >>
63-
- run:
64-
name: Ensure code compiles to JS.
65-
command: npm run compile -- << parameters.npm_script_extra_args >>
66-
- run:
67-
name: Run unit tests.
68-
command: npm run test -- << parameters.npm_script_extra_args >>
69-
- run:
70-
name: Submit coverage data to codecov.
71-
command: npm run codecov -- << parameters.npm_script_extra_args >>
72-
when: always
73-
7418
publish_npm:
7519
docker:
7620
- image: node:8

.github/workflows/ci.yaml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,52 @@ name: ci
66
jobs:
77
test:
88
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
node: [8, 10, 12, 14, 16]
13+
include:
14+
# use npm 7 by default
15+
- npm-version: ^7
16+
- node: 8
17+
# overrides for node 8
18+
npm-version: ^6
19+
lerna-extra-args: --ignore @opencensus/exporter-stackdriver
20+
env:
21+
OPENCENSUS_MONGODB_TESTS: 1
22+
OPENCENSUS_REDIS_TESTS: 1
23+
services:
24+
mongo_service:
25+
image: mongo
26+
ports: ["27017:27017"]
27+
redis_service:
28+
image: redis
29+
ports: ["6379:6379"]
30+
931
steps:
10-
- run: echo "hello world"
32+
- uses: actions/checkout@v2
33+
- uses: actions/setup-node@v2
34+
with:
35+
node-version: ${{ matrix.node }}
36+
- uses: actions/cache@v2
37+
with:
38+
path: ~/.npm
39+
key: v1-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
40+
restore-keys: |
41+
v1-node-${{ matrix.node }}-
42+
v1-node-
43+
- name: Upgrade to latest npm
44+
run: npm install -g npm@${{ matrix.npm-version }}
45+
- name: Print node/npm version
46+
run: node --version && npm --version
47+
48+
# compile runs in prepare
49+
- name: Install modules and dependencies, compile
50+
run: npm install
51+
52+
# lint runs in posttest
53+
- name: Run unit tests and lint
54+
run: npm run test -- ${{ matrix.lerna-extra-args }}
55+
- name: Submit coverage data to codecov.
56+
run: npm run codecov -- ${{ matrix.lerna-extra-args }}
57+
if: ${{ success() && matrix.node == '12' }}

0 commit comments

Comments
 (0)