-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (93 loc) · 3.29 KB
/
Copy pathtest.yaml
File metadata and controls
107 lines (93 loc) · 3.29 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
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
name: Run Tests
on:
push: # Every push to every branch
branches:
- '*' # matches every branch that doesn't contain a '/'
- '*/*' # matches every branch containing a single '/'
- '**' # matches every branch
jobs:
prepare-keys:
runs-on: blacksmith-2vcpu-ubuntu-2204
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install GnuPG
run: sudo apt-get update && sudo apt-get install -y gnupg
- name: Write and Encrypt validator_key.priv
run: |
printf "%s" "${{ secrets.VALIDATOR_KEY_PRIV }}" > validator_key.priv.tmp
gpg --batch --passphrase "${{ secrets.GPG_PASSPHRASE }}" --symmetric --cipher-algo AES256 --output validator_key.priv.gpg validator_key.priv.tmp
rm validator_key.priv.tmp
- name: Upload encrypted keys as artifact
uses: actions/upload-artifact@v4
with:
name: validator-keys
path: |
validator_key.priv.gpg
unit-test:
runs-on: blacksmith-4vcpu-ubuntu-2204
needs: prepare-keys
timeout-minutes: 4 # Shoudn't take this long
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: useblacksmith/setup-python@v6
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flit
python -m flit install
python -m pip install pytest
- name: Download encrypted keys
uses: actions/download-artifact@v4
with:
name: validator-keys
- name: Install GnuPG for decryption
run: sudo apt-get update && sudo apt-get install -y gnupg
- name: Decrypt validator_key.priv
run: |
gpg --batch --passphrase "${{ secrets.GPG_PASSPHRASE }}" --decrypt --output validator_key.priv validator_key.priv.gpg
- name: Run Unit tests
run: |
python -m pytest --verbose tests/units
integration-test:
runs-on: blacksmith-2vcpu-ubuntu-2204
needs: prepare-keys
timeout-minutes: 10 # 10 min is the hecking maximum
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: useblacksmith/setup-python@v6
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flit
python -m flit install
python -m pip install pytest
- name: Download encrypted keys
uses: actions/download-artifact@v4
with:
name: validator-keys
- name: Install GnuPG for decryption
run: sudo apt-get update && sudo apt-get install -y gnupg
- name: Decrypt validator_key.priv
run: |
gpg --batch --passphrase "${{ secrets.GPG_PASSPHRASE }}" --decrypt --output validator_key.priv validator_key.priv.gpg
- name: Run Integration tests
run: |
python -m pytest --verbose tests/integration
delete-keys-artifact:
runs-on: blacksmith-2vcpu-ubuntu-2204
needs: [unit-test, integration-test]
if: always()
permissions:
actions: write
steps:
- name: Delete validator-keys artifact
uses: geekyeggo/delete-artifact@v5
with:
name: validator-keys