-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (64 loc) · 2.4 KB
/
Copy pathtest.yaml
File metadata and controls
68 lines (64 loc) · 2.4 KB
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
name: hopdr-test
on: [push]
defaults:
run:
working-directory: hopdr
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
container: moratorium08/hopdr:aplas24
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Add hopdr/bin to PATH
run: echo "$GITHUB_WORKSPACE/hopdr/bin" >> $GITHUB_PATH
# These initializations have been done in Dockerfile
# but GitHub Actions override $HOME, and I don't know
# what is the best way to tackle this. So, I just re-install
# the packages here.
- name: rust init
run: rustup default stable
- name: opam init
run: opam init -a -y && eval $(opam env) && opam install -y ocamlformat dune
- name: Format
run: cargo fmt --all -- --check
- name: Build
run: cargo build
- name: Test
run: eval $(opam env) && cargo test --verbose
- name: Functional Test
run: eval $(opam env) && ./test.sh
- name: Notify Slack
if: failure()
id: slack
uses: slackapi/slack-github-action@v1.25.0
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
channel-id: ${{ secrets.DEV_CHANNEL }}
payload: |
{
"attachments":
[
{
"mrkdwn_in": ["text"],
"color": "danger",
"author_name": "Github Actions",
"title": "Test Failed",
"title_link": "${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
"text": ":x: Test Failed\n Reason: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}
]
}
- name: Benchmark
run: cd scripts && eval $(opam env) && python3 bench.py --base $PWD/../benchmark --timeout 180 --json golem_unsafe.json golem_unsafe && python3 bench.py --base $PWD/../benchmark --timeout 10 --json golem_safe.json golem_safe
- name: install requests
run: apt install -y python3-pip && pip install requests
- name: Notify
env:
SLACK_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
CHANNEL_ID: ${{ secrets.DEV_CHANNEL }}
run: cd scripts && python3 benchmark_scripts/slack-notify/slack_notify.py "<${{ github.event.pull_request.html_url || github.event.head_commit.url }}|commit>" golem_safe.json golem_unsafe.json