This repository was archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 455
80 lines (78 loc) · 2.61 KB
/
ci.yml
File metadata and controls
80 lines (78 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: CI
on:
push:
branches-ignore:
- develop
pull_request:
jobs:
ci:
name: CI
runs-on: ubuntu-18.04
steps:
- name: Check for GIT_API_KEY
id: check_token
run: echo ::set-output name=token_exists::${HAS_SECRET}
env:
HAS_SECRET: ${{ secrets.GIT_API_KEY != null }}
- name: Checkout (with GIT_API_KEY)
if: ${{ steps.check_token.outputs.token_exists == 'true' }}
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
with:
token: ${{ secrets.GIT_API_KEY }}
- name: Checkout (with GitHub Token)
if: ${{ steps.check_token.outputs.token_exists == 'false' }}
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
with:
token: ${{ github.token }}
- name: Setup Node.js v16.x.x
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'
- name: Update
run: |
yarn install && yarn upgrade && npx syncyarnlock@1.0.19 -s -k && rm -rf yarn.lock && yarn install
- name: Install
run: |
yarn --frozen-lockfile
- name: Lint
run: |
yarn lint
- name: Audit
run: |
yarn audit
- name: Test
run: |
yarn test
- name: Test Node
run: |
yarn test-node
- name: Test Types
run: |
yarn test-types
- name: Build
run: |
yarn build-web
- name: Test Web
uses: cypress-io/github-action@53cc3178f59cc99b5519c29c14a182fb98ea4f31
with:
spec: cypress/integration/index.spec.js
- name: Get Protected Status
if: github.event_name == 'push'
id: protected_step
run: |
PROTECTED=$(curl "https://api.github.com/repos/${{ github.repository }}/branches/${GITHUB_REF#refs/*/}" 2>/dev/null | jq -r '.protected')
echo ::set-output name=protected::$PROTECTED
- name: Commit/Push
if: github.event_name == 'push' && steps.protected_step.outputs.protected == 'false' && github.actor != 'dependabot[bot]'
run: |
git config --global user.name 'Block.one DevOps'
git config --global user.email 'blockone-devops@users.noreply.github.com'
git commit package.json yarn.lock -m "Updating package.json and yarn.lock" || echo "Nothing to commit"
git push origin ${GITHUB_REF#refs/*/}
services:
nodeos:
image: eosio/eosjs-ci:release_2.2.x
ports:
- 8888:8888
- 9876:9876