forked from RunestoneInteractive/RunestoneServer
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (84 loc) · 3.7 KB
/
Copy pathpython-app.yml
File metadata and controls
90 lines (84 loc) · 3.7 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
# This workflow will install Python dependencies, run tests and lint with a single version of Python.
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Runestone Server Tests
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
env:
WEB2PY_CONFIG: test
TEST_DBURL: postgres://runestone:runestone@localhost/runestone_test
LANG: en_US.UTF-8
WEB2PY_VERSION: 2.20.4
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
steps:
- uses: actions/checkout@v2
- uses: Harmon758/postgresql-action@v1.0.0
with:
postgresql db: runestone_test
postgresql user: runestone
postgresql password: runestone
- uses: actions/setup-java@v1.4.3
with:
java-version: 1.8
java-package: jre
- uses: supercharge/redis-github-action@1.1.0
- uses: act10ns/slack@v1
with:
status: starting
channel: "#builds"
if: always()
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: actions/setup-node@v2.1.2
- name: Install dependencies
id: setup-environment
run: |
# Put this repo in the ``runestone`` subdirectory.
mkdir -p web2py/applications/runestone
shopt -s extglob
mv !(web2py) web2py/applications/runestone
# Download and set up web2py.
wget --no-verbose http://web2py.com/examples/static/${WEB2PY_VERSION}/web2py_src.zip
unzip -q web2py_src.zip
# Define a web2py private key.
mkdir web2py/applications/runestone/private
echo "sha512:16492eda-ba33-48d4-8748-98d9bbdf8d33" > web2py/applications/runestone/private/auth.key
# Get the latest RS components and build webpack.
git clone https://github.com/RunestoneInteractive/RunestoneComponents.git
cd RunestoneComponents
npm install
npm run build
# Get the BookServer -- it's required by the Poetry install.
cd ..
git clone https://github.com/bnmnetp/BookServer.git
cd web2py
pushd applications/runestone
# Install Poetry.
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -
# Install the Runestone Server dependencies.
python3 -m pip install toml
python3 runestone_poetry_project/make_dev_pyproject.py
poetry install
popd
cp applications/runestone/tests/.coveragerc .
- name: Test with pytest
id: pytest
run: |
echo $TEST_DBURL
# Poetry can't run from outside its project. Here's a workaround.
cd web2py/applications/runestone
poetry run bash -c "cd ../.. && pytest -v applications/runestone/tests"
- uses: act10ns/slack@v1
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: "#builds"
if: always()