This repository has been archived by the owner on Jun 7, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 37
74 lines (66 loc) · 2.63 KB
/
python-package.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
# ****************************
# |docname| - CI configuration
# ****************************
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: BookServer Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
env:
BOOK_SERVER_CONFIG: test
TEST_DBURL: postgresql://postgres:foo@localhost/runestone
RUNESTONE_PATH: ${{ github.workspace }}/../RunestoneServer
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
strategy:
matrix:
# TODO: Enable Python 3.11 tests when `asyncpg supports it <https://github.com/MagicStack/asyncpg/issues/850>`.
python-version: ["3.9", "3.10"]
steps:
- name: Check out bookserver from GitHub.
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Start Redis
uses: supercharge/[email protected]
with:
redis-version: 6
- name: Install pre-reqs
run: |
# Start PostgreSQL. It's pre-installed; using a Docker image means we need to also install a client locally, and it's easy for the versions of the two to get out of sync and cause very weird errors.
sudo systemctl start postgresql.service
# Wait until the database is ready.
pg_isready
# Set a password for the postgres user to match the password in the ``TEST_DBURL`` above.
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'foo';"
# Install and build the Runestone Components.
mkdir ../RunestoneComponents
git clone https://github.com/RunestoneInteractive/RunestoneComponents.git ../RunestoneComponents
pushd ../RunestoneComponents
npm install
npm run build
popd
# Install the old server
git clone https://github.com/RunestoneInteractive/RunestoneServer.git ../RunestoneServer
# Prep pip for bookserver installation.
pip install -U pip
pip install poetry
- name: Install bookserver
run: |
poetry install
- name: Run the Pre Commit Check Script
run: |
poetry run python ./pre_commit_check.py
- uses: act10ns/slack@v1
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: "#builds"
if: always()