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

chore: use github actions for CI runs #905

Merged
merged 1 commit into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 0 additions & 56 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,69 +8,13 @@ workflows:
version: 2
tests:
jobs:
# Separate node8 from others to ignore any packages that no longer
# support node8
- unit_tests:
name: node8
filters: *release_tags
node_version: 8
npm_script_extra_args: --ignore @opencensus/exporter-stackdriver
- unit_tests:
name: node<< matrix.node_version >>
filters: *release_tags
matrix:
parameters:
node_version: [10, 11, 12]
- publish_npm:
requires:
- node8
- node10
- node11
- node12
filters:
branches:
ignore: /.*/
<<: *release_tags

jobs:
unit_tests:
docker:
- image: node:<< parameters.node_version >>
user: node
environment:
OPENCENSUS_MONGODB_TESTS: 1
OPENCENSUS_REDIS_TESTS: 1
- mongo_service:
image: mongo
- redis_service:
image: redis
parameters:
node_version:
description: The node version to run the tests with
type: integer
npm_script_extra_args:
description: Extra arguments passed to npm scripts
type: string
default: ""
steps:
- checkout
- run:
name: Install modules and dependencies.
command: npm install
- run:
name: Check code style and linting
command: npm run check -- << parameters.npm_script_extra_args >>
- run:
name: Ensure code compiles to JS.
command: npm run compile -- << parameters.npm_script_extra_args >>
- run:
name: Run unit tests.
command: npm run test -- << parameters.npm_script_extra_args >>
- run:
name: Submit coverage data to codecov.
command: npm run codecov -- << parameters.npm_script_extra_args >>
when: always

publish_npm:
docker:
- image: node:8
Expand Down
49 changes: 48 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,52 @@ name: ci
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [8, 10, 12, 14, 16]
include:
# use npm 7 by default
- npm-version: ^7
- node: 8
# overrides for node 8
npm-version: ^6
lerna-extra-args: --ignore @opencensus/exporter-stackdriver
env:
OPENCENSUS_MONGODB_TESTS: 1
OPENCENSUS_REDIS_TESTS: 1
services:
mongo_service:
image: mongo
ports: ["27017:27017"]
redis_service:
image: redis
ports: ["6379:6379"]

steps:
- run: echo "hello world"
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- uses: actions/cache@v2
with:
path: ~/.npm
key: v1-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
v1-node-${{ matrix.node }}-
v1-node-
- name: Upgrade to latest npm
run: npm install -g npm@${{ matrix.npm-version }}
- name: Print node/npm version
run: node --version && npm --version

# compile runs in prepare
- name: Install modules and dependencies, compile
run: npm install

# lint runs in posttest
- name: Run unit tests and lint
run: npm run test -- ${{ matrix.lerna-extra-args }}
- name: Submit coverage data to codecov.
run: npm run codecov -- ${{ matrix.lerna-extra-args }}
if: ${{ success() && matrix.node == '12' }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this would run on newest node, but workaround for codecov/codecov-node#284