This repository was archived by the owner on Dec 4, 2024. It is now read-only.
generated from stacks-network/.github
-
Notifications
You must be signed in to change notification settings - Fork 22
149 lines (127 loc) · 3.62 KB
/
pull-request.yml
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Pull Request
on:
pull_request:
branches: "main"
paths-ignore: ['**.md']
push:
branches: "main"
paths-ignore: ['**.md']
env:
CARGO_TERM_COLOR: always
jobs:
generate-lockfile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo generate-lockfile -v
- uses: actions/upload-artifact@v3
with:
name: Cargo.lock
path: Cargo.lock
linter:
needs: generate-lockfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: Cargo.lock
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- uses: davidB/rust-cargo-make@v1
with:
version: "0.36.13"
- name: Lint
run: cargo make --profile github-actions format
coverage:
needs: clarinet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: Cargo.lock
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: davidB/rust-cargo-make@v1
with:
version: "0.36.13"
- name: Coverage
run: cargo make --profile github-actions coverage-lcov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage/lcov.info
fail_ci_if_error: true
clarinet:
needs: linter
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustfmt
override: true
- name: Install clarinet develop version
run: chmod +x ./romeo/asset-contract/scripts/install_clarinet_action.sh && ./romeo/asset-contract/scripts/install_clarinet_action.sh
- name: Run unit tests for romeo
working-directory: ./romeo/asset-contract
run: ./scripts/test.sh
- name: Print coverage report
working-directory: ./romeo/asset-contract
run: sudo apt-get install -qq -y lcov html2text > /dev/null && genhtml --branch-coverage .coverage/lcov.info -o .coverage/ && html2text .coverage/contracts/index.html
- name: "Export romeo code coverage"
uses: codecov/codecov-action@v3
with:
directory: ./romeo/asset-contract/.coverage/
files: lcov.info
verbose: false
flags: unittests
ignore: tests
devenv:
timeout-minutes: 120
runs-on: ubuntu-latest
permissions:
pull-requests: read
steps:
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
devenv:
- 'devenv/**'
- name: Checkout
if: steps.changes.outputs.devenv == 'true'
uses: actions/checkout@v3
- name: Build devenv containers
if: steps.changes.outputs.devenv == 'true'
run: ./devenv/build.sh
vitest:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Use Node
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: ./romeo/asset-contract/package-lock.json
- run: npm ci
working-directory: ./romeo/asset-contract
- run: npm run test
working-directory: ./romeo/asset-contract