generated from project-kardeshev/ao-lua-process-template
-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (134 loc) · 4.67 KB
/
build_test_evolve.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
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
name: Build and Test
on:
workflow_dispatch:
pull_request:
push:
branches:
- develop
- main
jobs:
unit:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
name: Check out repository code
- name: Setup Lua
uses: leafo/gh-actions-lua@v10
with:
luaVersion: '5.3' # Specify the Lua version you need
- name: Setup LuaRocks
uses: leafo/gh-actions-luarocks@v4.3.0
- name: Install Busted
run: luarocks install ar-io-ant-registry-0.1-1.rockspec
- name: Run Busted Tests
run: busted .
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.0.2
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn --frozen-lockfile
- run: yarn aos:build
- run: yarn test:integration
evolve:
# Run on main branch only
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
needs: [integration, unit]
environment: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.0.2
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn --frozen-lockfile
- run: yarn evolve
env:
WALLET: ${{ secrets.WALLET }}
REGISTRY_ID: ${{ vars.REGISTRY_ID }}
- name: Notify Success
if: success()
uses: rtCamp/action-slack-notify@v2.3.0
env:
SLACK_COLOR: ${{ job.status }}
SLACK_TITLE: Update Proposed to ANT Registry Process!
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CUSTOM_PAYLOAD: |
{
"attachments": [{
"fallback": "Update Proposed for ANT Registry!",
"color": "good",
"title": "Details",
"text": 'The ANT Registry ${{ github.ref_name == 'main' && 'Testnet' || 'Devnet' }} Process has an update Proposal!',
"fields": [{
"title": "Network",
"value": "${{ github.ref_name == 'main' && 'testnet' || 'devnet' }}",
"short": true
},
{
"title": "Process ID",
"value": "${{ vars.REGISTRY_ID }}",
"short": true
},
{
"title": "View on ao.link",
"value": "https://www.ao.link/#/entity/${{ vars.REGISTRY_ID }}?tab=source-code",
"short": false
},
{
"title": "Vote on this proposal in VAOT",
"value": "https://vaot.ar.io/#/${{ vars.REGISTRY_ID }}",
"short": false
},
{
"title": "Commit",
"value": "<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
}
]
}]
}
- name: Notify Failure
if: failure()
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: danger
SLACK_TITLE: ANT Registry Process update Proposal FAILED!
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CUSTOM_PAYLOAD: |
{
"text": "ANT Registry Process Proposal Failed!",
"attachments": [{
"fallback": "Failed to propose update to ANT Registry!",
"color": "danger",
"title": "Details",
"text": 'The ANT Registry ${{ github.ref_name == 'main' && 'Testnet' || 'Devnet' }} Process FAILED to create an update Proposal!',
"fields": [{
"title": "Network",
"value": "${{ github.ref_name == 'main' && 'testnet' || 'devnet' }}",
"short": true
},
{
"title": "Process ID",
"value": "${{ vars.REGISTRY_ID }}",
"short": true
},
{
"title": "GitHub Action",
"value": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"short": false
},
{
"title": "Commit",
"value": "<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
}
]
}]
}