-
Notifications
You must be signed in to change notification settings - Fork 33
130 lines (114 loc) · 3.97 KB
/
compliance-test.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
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
# Workflow for running the TES compliance suite against Funnel
# This includes the following steps:
# 1. Build Funnel and store the resulting binary artifact
# 2. Install tes-compliance-suite and run against every version of TES simultaneously
# 3. start-report-deployment: Send a dispatch to the funnel-compliance repository to generate and publish
# the tes-compliance-suite report to https://ohsu-comp-bio.github.io/funnel-compliance/
# Optionally debug via SSH
# Ref: https://fleetdm.com/engineering/tips-for-github-actions-usability
#
# To use this step uncomment and place anywhere in the build steps. The build will pause on this step and
# output a ssh address associated with the Github action worker. Helpful for debugging build steps and
# and intermediary files/artifacts.
#
# Example:
# Web shell: https://tmate.io/t/q8FU3U9SvmMVxAhMHRyExNhr8
# SSH: ssh q8FU3U9SvmMVxAhMHRyExNhr8@sfo2.tmate.io
#
# - name: "Debug: Package dependancies for tmate (CentOS)"
# run: |
# yum install -y xz
# ln -s /bin/true /bin/apt-get
#
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
name: Compliance Test
on:
push:
jobs:
build:
runs-on: ubuntu-latest
container: quay.io/ohsu-comp-bio/slurm
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.18
- name: Check out code
uses: actions/checkout@v2
- name: Build
run: make build
- name: Store funnel
uses: actions/upload-artifact@v2
with:
name: funnelBin
path: funnel
compliance:
strategy:
fail-fast: false
matrix:
version: [1.0.0, 1.1.0]
db: ["boltdb", "mongodb"]
compute: ["local", "slurm"]
needs: build
runs-on: ubuntu-latest
container:
image: quay.io/ohsu-comp-bio/slurm
options: --hostname slurmctl --cap-add sys_admin
steps:
# Required to access the 'tests/mongo.config.yml' file
# Perhaps uploading it as an artifact would be more efficient?
- name: Check out code
uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
name: funnelBin
- name: Start Funnel server
run: |
touch config.yml
if [ ${{ matrix.db }} = "mongodb" ]; then
make start-mongodb
cat `pwd`/tests/mongo.config.yml >> config.yml
# Required for Funnel to connect MongoDB
echo "172.17.0.1 localhost" >> /etc/hosts
elif [ ${{ matrix.compute }} = "slurm" ]; then
cat `pwd`/tests/slurm.config.yml >> config.yml
cp config.yml /opt/funnel_config.yml
# Start Slurm
/usr/local/bin/docker-entrypoint.sh
fi
chmod +x funnel
FLAGS="--config `pwd`/config.yml"
./funnel server run $FLAGS &> funnel.logs &
- uses: actions/checkout@v3
with:
repository: lbeckman314/tes-compliance-suite
ref: feature/tesv1.1
path: tes-compliance-suite
- name: Install TES compliance suite
run: |
cd tes-compliance-suite
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python setup.py install
mkdir reports
- name: Test compliance
run: |
cd tes-compliance-suite
source venv/bin/activate
tes-compliance-suite report --version "${{ matrix.version }}" --server "http://localhost:8000/"
start-report-deployment:
needs: compliance
runs-on: ubuntu-latest
steps:
# https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-dispatch-event
- name: Start report generation
uses: passeidireto/trigger-external-workflow-action@main
env:
PAYLOAD_AUTHOR: "Funnel"
PAYLOAD_REVISION: "3"
with:
repository: ohsu-comp-bio/funnel-compliance
event: start-report
github_pat: ${{ secrets.ACTIONS_TOKEN }}