Skip to content

Commit

Permalink
GitHub CI actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kremalicious committed Jun 15, 2021
1 parent b37588c commit b7e7814
Showing 1 changed file with 120 additions and 0 deletions.
120 changes: 120 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: 'CI'

on:
push:
branches:
- main
tags:
- '**'
pull_request:
branches:
- '**'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '15'
- name: Cache node_modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-lint-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-lint-${{ env.cache-name }}-
- run: npm ci
- run: npm run lint

unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '15'
- name: Cache node_modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-unit-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-unit-${{ env.cache-name }}-
- run: npm ci
- run: npm run build:metadata
- run: npm run test:unit:cover

integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '15'
- name: Cache node_modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-integration-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-integration-${{ env.cache-name }}-
- run: npm ci
- name: Checkout Barge
uses: actions/checkout@v2
with:
repository: 'oceanprotocol/barge'
path: 'barge'
- name: Run Barge
working-directory: ${{ github.workspace }}/barge
env:
ADDRESS_FILE: '${HOME}/.ocean/ocean-contracts/artifacts/address.json'
AQUARIUS_URI: 'http://172.15.0.5:5000'
DEPLOY_CONTRACTS: 'true'
run: |
if [[ -n "$DOCKERHUB_PASSWORD" && -n "$DOCKERHUB_USERNAME" ]]; then echo "login to docker";echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin; fi &
bash -x start_ocean.sh --no-dashboard 2>&1 > start_ocean.log &
cd .. &
./scripts/waitforcontracts.sh
- run: npm run test:integration:cover

build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: ['15', '16']

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Cache node_modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-${{ matrix.node }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-${{ matrix.node }}-build-${{ env.cache-name }}-
- run: npm ci
- run: npm run build

# coverage:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
# - run: npm ci
# - uses: paambaati/codeclimate-action@v2.7.5
# env:
# CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
# with:
# coverageCommand: npm test

0 comments on commit b7e7814

Please sign in to comment.