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

Commit

Permalink
chore: use github actions for CI runs
Browse files Browse the repository at this point in the history
  • Loading branch information
aabmass committed Jul 16, 2021
1 parent 03d0c9e commit 693c18a
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 57 deletions.
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
44 changes: 43 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,47 @@ name: ci
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [8, 10, 12, 14, 16]
include:
- node: 8
- npm_script_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: 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.npm_script_extra_args }}
- name: Submit coverage data to codecov.
run: npm run codecov -- ${{ matrix.npm_script_extra_args }}
if: ${{ success() && matrix.node == '12' }}

0 comments on commit 693c18a

Please sign in to comment.