Skip to content

Commit a67c5fc

Browse files
committed
CI GH actions
1 parent fecbbaa commit a67c5fc

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

.github/workflows/cadence_lint.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Run Cadence Lint
2+
on: push
3+
4+
jobs:
5+
run-cadence-lint:
6+
runs-on: macos-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v3
10+
with:
11+
submodules: 'true'
12+
13+
- name: Install Flow CLI
14+
run: |
15+
brew update
16+
brew install flow-cli
17+
18+
- name: Initialize Flow
19+
run: |
20+
if [ ! -f flow.json ]; then
21+
echo "Initializing Flow project..."
22+
flow init
23+
else
24+
echo "Flow project already initialized."
25+
fi
26+
27+
- name: Run Cadence Lint
28+
run: |
29+
echo "Running Cadence linter on all .cdc files in the current repository"
30+
flow cadence lint **/*.cdc

.github/workflows/cadence_tests.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Run Cadence Tests
2+
on: push
3+
4+
jobs:
5+
run-cadence-tests:
6+
runs-on: macos-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v3
10+
with:
11+
submodules: 'true'
12+
13+
- name: Install Flow CLI
14+
run: |
15+
brew update
16+
brew install flow-cli
17+
18+
- name: Initialize Flow
19+
run: |
20+
if [ ! -f flow.json ]; then
21+
echo "Initializing Flow project..."
22+
flow init
23+
else
24+
echo "Flow project already initialized."
25+
fi
26+
27+
- name: Run Cadence Tests
28+
run: |
29+
if test -f "cadence/tests.cdc"; then
30+
echo "Running Cadence tests in the current repository"
31+
flow test cadence/tests.cdc
32+
else
33+
echo "No Cadence tests found. Skipping tests."
34+
fi

0 commit comments

Comments
 (0)