Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move coverage to GitHub actions #10898

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
47 changes: 0 additions & 47 deletions .circleci/config.yml
Expand Up @@ -9,28 +9,6 @@ aliases:
keys:
- v1-yarn-cache

- &save-node-modules-cache
paths:
- node_modules
key: v1-yarn-deps-{{ checksum "yarn.lock" }}

- &save-yarn-cache
paths:
- ~/.yarn-cache
key: v1-yarn-cache

- &artifact_babel
path: ~/babel/packages/babel-standalone/babel.js

- &artifact_babel_min
path: ~/babel/packages/babel-standalone/babel.min.js

- &artifact_env
path: ~/babel/packages/babel-preset-env-standalone/babel-preset-env.js

- &artifact_env_min
path: ~/babel/packages/babel-preset-env-standalone/babel-preset-env.min.js

- &test262_workdir
working_directory: ~/babel/babel-test262-runner

Expand All @@ -50,28 +28,6 @@ executors:
working_directory: ~/babel

jobs:
test:
executor: node-executor
steps:
- checkout
- restore_cache: *restore-yarn-cache
- restore_cache: *restore-node-modules-cache
- run: yarn --version
- run: make test-ci-coverage
# Builds babel-standalone with the regular Babel config
- run: IS_PUBLISH=true make build
# test-ci-coverage doesn't test babel-standalone, as trying to gather coverage
# data for a JS file that's several megabytes large is bound to fail. Here,
# we just run the babel-standalone test separately.
- run: ./node_modules/.bin/jest packages/babel-standalone/test/
- run: ./node_modules/.bin/jest packages/babel-preset-env-standalone/test/
- store_artifacts: *artifact_babel
- store_artifacts: *artifact_babel_min
- store_artifacts: *artifact_env
- store_artifacts: *artifact_env_min
- save_cache: *save-node-modules-cache
- save_cache: *save-yarn-cache

test262:
executor: node-executor
steps:
Expand Down Expand Up @@ -156,9 +112,6 @@ jobs:

workflows:
version: 2
test:
jobs:
- test
test262-master:
jobs:
- test262:
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/coverage.yml
@@ -0,0 +1,51 @@
name: Report Coverage

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [13.x]
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Environment log
id: env
run: |
echo "::set-output name=yarn-cache-dir::$(yarn cache dir)"
yarn --version
- name: Get node_modules cache
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Get yarn cache
uses: actions/cache@v1
with:
path: ${{ steps.env.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Generate coverage report
run: |
yarn --version
make test-ci-coverage
# Builds babel-standalone with the regular Babel config
# test-ci-coverage doesn't test babel-standalone, as trying to gather coverage
IS_PUBLISH=true make build-standalone
# data for a JS file that's several megabytes large is bound to fail. Here,
# we just run the babel-standalone test separately.
yarn jest "\-standalone/test"
Copy link
Member

Choose a reason for hiding this comment

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

Since this is just for coverage, maybe we can avoid testing standalone here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The standalone is only tested on the coverage job in the CI, we have skipped the test on other executors.

Copy link
Member

Choose a reason for hiding this comment

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

Oh then maybe we should test it separately? I don't really see how it fits in the coverage tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah but standalone will rely on building and installing all the dependencies, I think we can test it here to save redundant machine hours.

Copy link
Member

Choose a reason for hiding this comment

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

Ok fair

- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}