Migrate to GitHub Actions
This commit is contained in:
@ -1,84 +0,0 @@
|
|||||||
version: 2
|
|
||||||
# 2.1 does not yet support local run
|
|
||||||
# unless with workaround. For simplicity just use it.
|
|
||||||
# https://github.com/CircleCI-Public/circleci-cli/issues/79
|
|
||||||
|
|
||||||
aliases:
|
|
||||||
- &defaults
|
|
||||||
docker:
|
|
||||||
- image: circleci/node:10
|
|
||||||
|
|
||||||
- &cache_key_node_modules
|
|
||||||
key: v1-node_modules-{{ checksum "package-lock.json" }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
dependencies:
|
|
||||||
<<: *defaults
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- restore_cache:
|
|
||||||
<<: *cache_key_node_modules
|
|
||||||
- run:
|
|
||||||
name: Install npm dependencies and prepare
|
|
||||||
command: |
|
|
||||||
if [ ! -d node_modules ]; then
|
|
||||||
npm ci
|
|
||||||
else
|
|
||||||
npm run prepare
|
|
||||||
fi
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: .
|
|
||||||
paths:
|
|
||||||
- node_modules
|
|
||||||
- build
|
|
||||||
- save_cache:
|
|
||||||
paths:
|
|
||||||
- node_modules
|
|
||||||
<<: *cache_key_node_modules
|
|
||||||
|
|
||||||
lint:
|
|
||||||
<<: *defaults
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- attach_workspace:
|
|
||||||
at: .
|
|
||||||
- run:
|
|
||||||
name: Linter
|
|
||||||
command: npm run lint
|
|
||||||
test:
|
|
||||||
<<: *defaults
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- attach_workspace:
|
|
||||||
at: .
|
|
||||||
- run:
|
|
||||||
name: Unit tests
|
|
||||||
command: npm run test
|
|
||||||
|
|
||||||
coverage:
|
|
||||||
<<: *defaults
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- attach_workspace:
|
|
||||||
at: .
|
|
||||||
- run:
|
|
||||||
name: Unit tests with coverage report
|
|
||||||
command: npm run coverage
|
|
||||||
|
|
||||||
# TODO(xinbenlv, #1839): run SOLC_NIGHTLY to be run but allow it to fail.
|
|
||||||
|
|
||||||
workflows:
|
|
||||||
version: 2
|
|
||||||
everything:
|
|
||||||
jobs:
|
|
||||||
- dependencies
|
|
||||||
- lint:
|
|
||||||
requires:
|
|
||||||
- dependencies
|
|
||||||
- test:
|
|
||||||
requires:
|
|
||||||
- dependencies
|
|
||||||
- coverage:
|
|
||||||
requires:
|
|
||||||
- dependencies
|
|
||||||
|
|
||||||
39
.github/workflows/test.yml
vendored
Normal file
39
.github/workflows/test.yml
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
name: Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
pull_request: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 10.x
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: npm-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
restore-keys: npm-
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm run lint
|
||||||
|
- run: npm run test
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 10.x
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: npm-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
restore-keys: npm-
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm run coverage
|
||||||
|
- uses: codecov/codecov-action@v1
|
||||||
@ -44,13 +44,6 @@ npm test
|
|||||||
npm run lint
|
npm run lint
|
||||||
```
|
```
|
||||||
|
|
||||||
or you can simply run CircleCI locally
|
|
||||||
```bash
|
|
||||||
circleci local execute --job build
|
|
||||||
circleci local execute --job test
|
|
||||||
```
|
|
||||||
*Note*: requires installing CircleCI and docker locally on your machine.
|
|
||||||
|
|
||||||
5) Go to [github.com/OpenZeppelin/openzeppelin-contracts](https://github.com/OpenZeppelin/openzeppelin-contracts) in your web browser and issue a new pull request.
|
5) Go to [github.com/OpenZeppelin/openzeppelin-contracts](https://github.com/OpenZeppelin/openzeppelin-contracts) in your web browser and issue a new pull request.
|
||||||
|
|
||||||
*IMPORTANT* Read the PR template very carefully and make sure to follow all the instructions. These instructions
|
*IMPORTANT* Read the PR template very carefully and make sure to follow all the instructions. These instructions
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
[](https://docs.openzeppelin.com/contracts)
|
[](https://docs.openzeppelin.com/contracts)
|
||||||
[](https://www.npmjs.org/package/@openzeppelin/contracts)
|
[](https://www.npmjs.org/package/@openzeppelin/contracts)
|
||||||
[](https://circleci.com/gh/OpenZeppelin/openzeppelin-contracts)
|
|
||||||
[](https://codecov.io/gh/OpenZeppelin/openzeppelin-contracts)
|
[](https://codecov.io/gh/OpenZeppelin/openzeppelin-contracts)
|
||||||
|
|
||||||
**A library for secure smart contract development.** Build on a solid foundation of community-vetted code.
|
**A library for secure smart contract development.** Build on a solid foundation of community-vetted code.
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"compile": "buidler compile",
|
"compile": "buidler compile",
|
||||||
"coverage": "scripts/coverage.sh",
|
"coverage": "buidler coverage",
|
||||||
"docs": "oz-docs",
|
"docs": "oz-docs",
|
||||||
"docs:watch": "npm run docs watch contracts 'docs/*.hbs'",
|
"docs:watch": "npm run docs watch contracts 'docs/*.hbs'",
|
||||||
"prepare-docs": "scripts/prepare-docs.sh",
|
"prepare-docs": "scripts/prepare-docs.sh",
|
||||||
|
|||||||
@ -1,9 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
buidler coverage
|
|
||||||
|
|
||||||
if [ -n "$CI" ]; then
|
|
||||||
curl -s https://codecov.io/bash | bash -s -- -C "$CIRCLE_SHA1"
|
|
||||||
fi
|
|
||||||
Reference in New Issue
Block a user