-
Notifications
You must be signed in to change notification settings - Fork 74
54 lines (54 loc) · 1.79 KB
/
test.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
# .github/workflows/build.yml
name: Clamscan Test Suite
on:
pull_request:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [12,13,14,15,16,17,18,19]
steps:
- name: Update Apt
run: sudo apt-get update
- name: Install ClamAV
run: sudo apt-get install clamav clamav-daemon
- name: Restart Freshclam
run: sudo systemctl restart clamav-freshclam
- name: Chill for 30 seconds
run: sleep 30
- name: Restart ClamD
run: sudo systemctl restart clamav-daemon
- name: Chill for 30 seconds again
run: sleep 30
- name: Install OpenSSL
run: sudo apt-get install openssl
- name: Generate Key Pair for TLS
run: openssl req -new -sha256 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=localhost" -newkey ed25519 -keyout key.pem -nodes -x509 -days 365 -out cert.pem
- name: Install stunnel
run: sudo apt-get install stunnel4
- name: Install / Trust certificate
run: |
sudo cp cert.pem /usr/local/share/ca-certificates/snakeoil.crt
sudo update-ca-certificates
sudo cp cert.pem /etc/stunnel/cert.pem
sudo cp key.pem /etc/stunnel/key.pem
- name: Checkout repository
uses: actions/checkout@v3
- name: Set stunnel config
run: sudo cp tests/stunnel.conf /etc/stunnel/
- name: Restart stunnel
run: sudo /etc/init.d/stunnel4 restart
- name: Open ~ for all users to read
run: chmod 755 ~
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test