-
Notifications
You must be signed in to change notification settings - Fork 7
75 lines (60 loc) · 2.71 KB
/
main.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
on:
push:
branches: [ main ]
paths:
- ".github/workflows/main.yml"
- "Cargo.*"
- "shinkai-libs/**"
- "shinkai-bin/**"
pull_request:
branches: [ main ]
types: [ opened, reopened, synchronize, ready_for_review ]
paths:
- ".github/workflows/main.yml"
- "Cargo.*"
- "shinkai-libs/**"
- "shinkai-bin/**"
name: Shinkai Test Workflow
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: self-hosted
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Build testing image
run: docker build -t testing_image:${SHORT_SHA} -f .github/Dockerfile .
- name: Run tests primitives cargo tests
run: docker run --rm --entrypoint /entrypoints/run-main-primitives-cargo-tests.sh testing_image:${SHORT_SHA}
- name: Run tests mirror cargo tests
run: docker run --rm --entrypoint /entrypoints/run-main-mirror-cargo-tests.sh testing_image:${SHORT_SHA}
- name: Run tests main cargo tests
run: docker run --rm -e AWS_ACCESS_KEY_ID='${{ secrets.AWS_ACCESS_KEY_ID }}' -e AWS_SECRET_ACCESS_KEY='${{ secrets.AWS_SECRET_ACCESS_KEY }}' -e AWS_URL='${{ secrets.AWS_URL }}' --entrypoint /entrypoints/run-main-cargo-tests.sh testing_image:${SHORT_SHA}
- name: Remove image
if: always()
run: docker rmi testing_image:${SHORT_SHA} || true
env:
FROM_WALLET_MNEMONICS: ${{ secrets.FROM_WALLET_MNEMONICS }}
FROM_WALLET_PRIVATE_KEY: ${{ secrets.FROM_WALLET_PRIVATE_KEY }}
test-wasm:
runs-on: self-hosted
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Build testing image - shinkai-message-wasm
run: docker build -t testing_image_wasm:${SHORT_SHA} -f .github/Dockerfile.wasm .
- name: Run tests shinkai-message-wasm cargo tests
run: docker run --rm --entrypoint /entrypoints/run-wasm-pack-tests.sh testing_image_wasm:${SHORT_SHA}
- name: Run tests shinkai-message-pyo3 python tests
run: docker run --rm --entrypoint /entrypoints/run-python-tests.sh testing_image_wasm:${SHORT_SHA}
- name: Remove image
if: always()
run: docker rmi testing_image_wasm:${SHORT_SHA} || true