-
Notifications
You must be signed in to change notification settings - Fork 7
169 lines (149 loc) · 4.98 KB
/
functionality.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Functionality tests
on:
pull_request:
env:
svc_list: 'finalize inbox ingest mapper verify'
jobs:
check_changes:
outputs:
sda-auth: ${{ steps.changes.outputs.sda-auth }}
sda-download: ${{ steps.changes.outputs.sda-download }}
sda-pipeline: ${{ steps.changes.outputs.sda-pipeline }}
sftp-inbox: ${{ steps.changes.outputs.sftp-inbox }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
sda-auth:
- 'sda-auth/**'
sda-download:
- 'sda-download/**'
sda-pipeline:
- 'sda-pipeline/**'
sftp-inbox:
- 'sftp-inbox/**'
sda-auth:
needs: check_changes
if: needs.check_changes.outputs.sda-auth == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version: ['1.20']
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Add oidc to /etc/hosts
run: |
sudo echo "127.0.0.1 oidc" | sudo tee -a /etc/hosts
- name: Start virtual infrastructure
run: |
cd sda-auth
GOLANG_VERSION=${{ matrix.go-version }} docker-compose -f ./dev-server/docker-compose.yml up -d --force-recreate --build
- name: Run unit tests
run: tox -e unit_tests -c sda-auth/tests/tox.ini
sda-download:
needs: check_changes
if: needs.check_changes.outputs.sda-download == 'true'
name: sda-download-integration-${{ matrix.storagetype }}
runs-on: ubuntu-latest
env:
STORAGETYPE: ${{ matrix.storagetype }}
strategy:
matrix:
storagetype: [s3, posix, s3notls]
fail-fast: false
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Run setup scripts
run: |
cd sda-download
ls -1 .github/integration/setup/{common,${{ matrix.storagetype }}}/*.sh 2>/dev/null | sort -t/ -k5 -n | while read -r runscript; do
echo "Executing setup script $runscript";
bash -x "$runscript";
done
- name: Run tests
run: |
cd sda-download
ls -1 .github/integration/tests/{common,${{ matrix.storagetype }}}/*.sh 2>/dev/null | sort -t/ -k5 -n | while read -r runscript; do
echo "Executing test script $runscript";
bash -x "$runscript";
done
sda-pipeline:
needs: check_changes
if: needs.check_changes.outputs.sda-pipeline == 'true'
name: sda-pipeline-integration-${{ matrix.storagetype }}
runs-on: ubuntu-latest
env:
STORAGETYPE: ${{ matrix.storagetype }}
strategy:
matrix:
storagetype: [s3, posix, s3notls, s3header, s3notlsheader, posixheader, sftp, sftpheader]
fail-fast: false
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Run setup scripts
run: |
cd sda-pipeline
ls -1 .github/integration/setup/{common,${{ matrix.storagetype }}}/*.sh 2>/dev/null | sort -t/ -k5 -n | while read -r runscript; do
echo "Executing setup script $runscript";
bash -x "$runscript";
done
- name: Run tests
run: |
cd sda-pipeline
ls -1 .github/integration/tests/{common,${{ matrix.storagetype }}}/*.sh 2>/dev/null | sort -t/ -k5 -n | while read -r runscript; do
echo "Executing test script $runscript";
bash -x "$runscript";
done
sftp-inbox:
needs: check_changes
if: needs.check_changes.outputs.sftp-inbox == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build image
run: |
cd sda-sftp-inbox
docker build -t neicnordic/sda-inbox-sftp:latest .
- name: Start Services
run: |
cd sda-sftp-inbox/dev_utils
bash ./make_certs.sh
docker-compose up certfixer
docker-compose up -d
sleep 20
- name: Run test for sftp ssh connection
run: |
cd sda-sftp-inbox
chmod 700 src/test/resources/id_ed25519
sh ./dev_utils/sftp-testing-ssh.sh
- name: Run test for sftp with password
run: |
cd sda-sftp-inbox
sudo apt-get install expect -y
sh ./dev_utils/sftp-testing-pass.sh