-
Notifications
You must be signed in to change notification settings - Fork 4
95 lines (87 loc) · 2.78 KB
/
workflow.yaml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Workflow
on:
push:
branches:
- main
pull_request:
jobs:
build:
continue-on-error: False
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive
- name: Get a specific Node.js version such that hardhat does not hang periodically
uses: actions/setup-node@v3
with:
node-version: "18.15.0"
# Install modules
- name: Install modules
run: yarn install
# Run linters
- name: Run ESLint
run: ./node_modules/.bin/eslint . --ext .js,.jsx,.ts,.tsx
- name: Run solhint
run: ./node_modules/.bin/solhint contracts/interfaces/*.sol contracts/*.sol contracts/test/*.sol
# Compile the code and run tests and deploy script(s)
- name: Run tests
run: ./node_modules/.bin/hardhat test
# Run hardhat coverage and upload codecov report
- name: Solidity coverage summary
run: ./node_modules/.bin/hardhat coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
docker:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build
uses: docker/build-push-action@v2
with:
context: .
push: false
tags: valory/${{ github.event.repository.name }}:dev
# - name: Login to DockerHub
# uses: docker/login-action@v1
# if: github.ref == 'refs/heads/main'
# with:
# username: valory
# password: ${{ secrets.ACCESS_TOKEN }}
# - name: Push
# uses: docker/build-push-action@v2
# if: github.ref == 'refs/heads/main'
# with:
# context: .
# push: true
# tags: valory/${{ github.event.repository.name }}:main # note need to get the base ref to force for the branch
scan:
name: gitleaks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: "1.17.7"
- run: |
wget https://github.com/zricethezav/gitleaks/releases/download/v8.10.1/gitleaks_8.10.1_linux_x64.tar.gz && \
tar -xzf gitleaks_8.10.1_linux_x64.tar.gz && \
sudo install gitleaks /usr/bin && \
gitleaks detect --report-format json --report-path leak_report -v