diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a198d3e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,66 @@ +name: BigChainDB wallet CI + +on: + push: + paths-ignore: + - 'README.md' + - '**/package-lock.json' + branches: + - main + pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review + paths-ignore: + - 'README.md' + - '**/package-lock.json' + branches: + - main + +jobs: + setup-and-test: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} + timeout-minutes: 10 + + strategy: + matrix: + node-version: [14.x] + + steps: + - name: Check out repository code + uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + + - name: Cache Node.js modules + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.OS }}-node- + ${{ runner.OS }}- + + - name: Install dependencies + run: npm run bootstrap + + - name: Build packages + run: npm run build + + - name: Run Jest tests + run: npm run test:cov + env: + CI: true + + - name: Upload coverage + uses: actions/upload-artifact@v2 + with: + name: coverage + path: ./coverage + retention-days: 2