forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (118 loc) · 5.09 KB
/
simulator-nightly.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
name: Simulator Tests
concurrency:
group: ${{ github.workflow }}
on:
schedule:
- cron: '0 9 * * *' # UTC timing is every day at 1am PST
workflow_dispatch:
jobs:
simtest:
timeout-minutes: 120
permissions:
# The "id-token: write" permission is required or Machine ID will not be
# able to authenticate with the cluster.
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Install Teleport
uses: teleport-actions/setup@8d23169da0f80ce14d25ed791272faa1c07f4f1e # pin@v1
with:
version: 11.3.1
- name: Authorize against Teleport
id: auth
uses: teleport-actions/auth@9091dad16a564f3c5b9c2ec520b234a4872b6879 # pin@v1
with:
# Specify the publically accessible address of your Teleport proxy.
proxy: proxy.mysten-int.com:443
# Specify the name of the join token for your bot.
token: sui-simtest-token
# Specify the length of time that the generated credentials should be
# valid for. This is optional and defaults to "1h"
certificate-ttl: 2h
# Cargo clean and git restore on any left over files from git checkout
- name: Environment clean
run: |
tsh -i ${{ steps.auth.outputs.identity-file }} --ttl 5 ssh ubuntu@simtest-01 "source ~/.bashrc && source ~/.cargo/env && cd ~/sui && cargo clean && git restore ."
# Deleting files in tmpfs that usually fill up pretty quickly after each run
- name: Tmpfs clean
run: |
tsh -i ${{ steps.auth.outputs.identity-file }} --ttl 5 ssh ubuntu@simtest-01 "sudo rm -rfd /tmp/*"
# Checkout out the latest sui repo
- name: Checkout sui repo
run: |
tsh -i ${{ steps.auth.outputs.identity-file }} --ttl 10 ssh ubuntu@simtest-01 "source ~/.bashrc && source ~/.cargo/env && cd ~/sui && git fetch origin main && git rebase origin/main"
# Setting up cargo and simtest
- name: Install simtest
run: |
tsh -i ${{ steps.auth.outputs.identity-file }} --ttl 10 ssh ubuntu@simtest-01 "source ~/.bashrc && source ~/.cargo/env && cd ~/sui && ./scripts/simtest/install.sh"
# Build simtest
- name: Build simtest
run: |
tsh -i ${{ steps.auth.outputs.identity-file }} --ttl 30 ssh ubuntu@simtest-01 "source ~/.bashrc && source ~/.cargo/env && cd ~/sui && CARGO_TERM_COLOR=always CARGO_INCREMENTAL=0 CARGO_NET_RETRY=10 USE_MOCK_CRYPTO=1 ./scripts/simtest/cargo-simtest simtest build"
# Run simulator tests
- name: Run simtest
run: |
tsh -i ${{ steps.auth.outputs.identity-file }} --ttl 120 ssh ubuntu@simtest-01 "source ~/.bashrc && source ~/.cargo/env && cd ~/sui && RUSTUP_MAX_RETRIES=10 CARGO_TERM_COLOR=always CARGO_INCREMENTAL=0 CARGO_NET_RETRY=10 RUST_BACKTRACE=short RUST_LOG=off USE_MOCK_CRYPTO=1 NUM_CPUS=12 ./scripts/simtest/simtest-run.sh"
notify:
name: Notify
needs: [simtest]
runs-on: ubuntu-latest
if: always() # always notify
steps:
- uses: technote-space/workflow-conclusion-action@v3
- name: Checkout sui repo main branch
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # pin@v3
- name: Get sui commit
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export sui_sha=$(git rev-parse HEAD)
echo "sui_sha=${sui_sha}" >> $GITHUB_ENV
- name: Get link to logs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh_job_link=$(gh api -X GET 'repos/MystenLabs/sui/actions/runs/${{ github.run_id }}/jobs' --jq '.jobs.[0].html_url')
echo "gh_job_link=${gh_job_link}" >> $GITHUB_ENV
- name: Post to slack
uses: slackapi/[email protected] # [email protected]
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SUI_SHA: ${{ env.sui_sha }}
GH_JOB_LINK: ${{ env.gh_job_link }}
with:
channel-id: 'simtest-nightly'
payload: |
{
"text": "*${{ github.workflow }}* workflow status: `${{ env.WORKFLOW_CONCLUSION }}`",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*${{ github.workflow }}* workflow status: `${{ env.WORKFLOW_CONCLUSION }}`"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Sui commit: <https://github.com/MystenLabs/sui/commit/${{ env.SUI_SHA }}|${{ env.SUI_SHA }}> \nRun: <${{ env.GH_JOB_LINK }}|${{ github.run_id }}>"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "To debug failures: `tsh ssh ubuntu@simtest-01` and look in the `/home/ubuntu/simtest_logs/{date}` folder for test results"
}
}
]
}