@@ -8,100 +8,111 @@ on: [push, pull_request]
88
99# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1010jobs :
11+ entangle :
12+ runs-on : ubuntu-latest
13+ steps :
14+ - uses : actions/checkout@v2
15+ - name : Check all entangled files are in sync with Markdown
16+ run : make check
1117 cpp :
1218 # The type of runner that the job will run on
1319 runs-on : ubuntu-latest
1420
1521 # Steps represent a sequence of tasks that will be executed as part of the job
1622 steps :
17- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
18- - uses : actions/checkout@v2
19-
20- # Should not be needed anymore when https://github.com/NLESC-JCER/cpp2wasm/issues/1 is fixed
21- - name : Generate source code
22- uses : docker://nlesc/pandoc-tangle:0.5.0
23- with :
24- args : --preserve-tabs README.md INSTALL.md
23+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
24+ - uses : actions/checkout@v2
2525
26- - name : Run C++ examples
27- run : make test-cli test-cgi
26+ - name : Run C++ examples
27+ run : make test-cli test-cgi
2828 python :
29- # The type of runner that the job will run on
29+ # The type of runner that the job will run on
30+ name : Python ${{ matrix.python-version }}
3031 runs-on : ubuntu-latest
32+ strategy :
33+ matrix :
34+ python-version : [3.6, 3.7, 3.8]
35+ fail-fast : true
3136 # Redis is needed for Celery
3237 services :
3338 redis :
3439 image : redis
3540 ports :
3641 - 6379:6379
3742 steps :
38- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
39- - uses : actions/checkout@v2
40-
41- # Should not be needed anymore when https://github.com/NLESC-JCER/cpp2wasm/issues/1 is fixed
42- - name : Generate source code
43- uses : docker://nlesc/pandoc-tangle
44- with :
45- args : --preserve-tabs README.md INSTALL.md
46-
47- - uses : actions/setup-python@v1
48- with :
49- python-version : ' 3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
50- architecture : ' x64' # optional x64 or x86. Defaults to x64 if not specified
51-
52- - name : Install Python dependencies
53- run : make py-deps && pip install httpie
54-
55- - name : Run Python example
56- run : make test-py
57-
58- - name : Start web application in background
59- run : make run-webapp &
60-
61- - name : Test web application
62- run : http --ignore-stdin -f localhost:5001 epsilon=0.001 guess=-20
63-
64- - name : Start web service in background
65- run : make run-webservice &
66-
67- - name : Test web service
68- run : make test-webservice
69-
70- - name : Start Celery web app in background
71- run : make run-celery-webapp &
72-
73- - name : Start Celery worker in background
74- run : |
75- cd src/py
76- PYTHONPATH=$PWD/../.. celery -A tasks worker &
77- cd ../..
78-
79- - name : Test Celery web app
80- run : |
81- http --ignore-stdin -hf localhost:5000 epsilon=0.001 guess=-20 | tee response.txt
82- # Parse result url from response
83- RESULT_URL=$(cat response.txt |grep Location |awk '{print $2}')
84- sleep 2
85- http --ignore-stdin $RESULT_URL
43+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
44+ - uses : actions/checkout@v2
45+
46+ - name : Set up Python ${{ matrix.python-version }}
47+ uses : actions/setup-python@v1
48+ with :
49+ python-version : ${{ matrix.python-version }}
50+ architecture : " x64"
51+
52+ - name : Which Python
53+ run : which python
54+
55+ - name : Install Python dependencies
56+ run : make py-deps && pip install httpie
57+
58+ - name : Run Python example
59+ run : make test-py
60+
61+ - name : Start web application in background
62+ run : make run-webapp 2>&1 | tee ./run-webapp.log &
63+
64+ - name : Test web application
65+ run : http --ignore-stdin -f localhost:5001 epsilon=0.001 guess=-20
66+
67+ - name : Start web service in background
68+ run : make run-webservice 2>&1 | tee ./run-webservice.log &
69+
70+ - name : Test web service
71+ run : make test-webservice
72+
73+ - name : Start Celery web app in background
74+ run : make run-celery-webapp 2>&1 | tee ./run-celery-webapp.log &
75+
76+ - name : Start Celery worker in background
77+ run : |
78+ cd src/py
79+ PYTHONPATH=$PWD/../.. celery -A tasks worker 2>&1 | tee ./run-celery-worker.log &
80+ cd ../..
81+
82+ - name : Test Celery web app
83+ run : |
84+ http --ignore-stdin -hf localhost:5000 epsilon=0.001 guess=-20 | tee response.txt
85+ # Parse result url from response
86+ RESULT_URL=$(cat response.txt |grep Location |awk '{print $2}')
87+ sleep 2
88+ http --ignore-stdin $RESULT_URL
89+
90+ - name : Upload log of services
91+ if : ${{ always() }}
92+ uses : actions/upload-artifact@v2
93+ with :
94+ name : service-logs
95+ path : ./run-*.log
8696 wasm :
8797 runs-on : ubuntu-latest
8898 steps :
8999 - uses : actions/checkout@v2
90100
91- # Should not be needed anymore when https://github.com/NLESC-JCER/cpp2wasm/issues/1 is fixed
92- - name : Generate source code
93- uses : docker://nlesc/pandoc-tangle
94- with :
95- args : --preserve-tabs README.md INSTALL.md
96-
97101 - name : Install emscripten
98102 uses : mymindstorm/setup-emsdk@v4
99103
100104 - name : Build WebAssembly module
101105 run : make build-wasm
102106
103107 - name : Start web server for hosting files in background
104- run : make host-files &
108+ run : make host-files 2>&1 | tee ./web-server.log &
105109
106110 - name : Run tests
107111 run : make test-wasm
112+
113+ - name : Upload log of web server
114+ if : ${{ always() }}
115+ uses : actions/upload-artifact@v2
116+ with :
117+ name : web-server-log
118+ path : ./web-server.log
0 commit comments