-
Notifications
You must be signed in to change notification settings - Fork 41
101 lines (97 loc) · 3.12 KB
/
pull_request.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
name: Internet.nl
on:
pull_request:
push:
branches:
- main
- release/*
jobs:
build:
runs-on: ubuntu-20.04
timeout-minutes: 15
env:
GITHUB_ACTIONS: True
ENABLE_BATCH: True
SECRET_KEY: Github
DEBUG: True
DB_NAME: internetnl
DB_USER: internetnluser
DB_PASSWORD: internetnluser
strategy:
matrix:
# Support Matrix from python.org/downloads:
# 3.7, 2023-06-27
# 3.8, 2024-10
# 3.9, 2025-10
# 3.10 2026-10
python-version: [ "3.10" ]
continue-on-error: false
services:
rabbitmq:
image: rabbitmq:3-management
ports:
- 15672:15672
- 5672:5672
postgres:
image: postgres:12.5
env:
POSTGRES_DB: internetnl
POSTGRES_USER: internetnluser
POSTGRES_PASSWORD: internetnluser
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 2
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run Redis 6
uses: supercharge/[email protected]
with:
redis-version: 6
- name: Install needed packages for build and run
run: |
sudo apt update
sudo apt-get update
sudo apt-get -y install libevent-dev libssl-dev libffi-dev python-dev swig libhiredis-dev
- name: Check out cache (only if match on OS, Python version, requirements, Makefile and workflow file)
uses: actions/cache@v3
id: cache-venv
with:
# Prevent re-building the venv when all requirements.txts stays the same.
path: |
./.venv/
./unbound/
./_unbound/
./nassl_freebsd/
key: ${{ runner.os }}-${{ matrix.python-version }}-v5-venv-and-deps-${{ hashFiles('**/requirements*.txt', 'Makefile', '.github/workflows/*') }}
# the venv and all (slow) custom dependencies is only built when there was no cache hit.
- name: Make venv (if not from cache)
run: make venv
if: ${{ steps.cache-venv.outputs.cache-hit != 'true' }}
- name: Make nassl (if not from cache)
run: make nassl
if: ${{ steps.cache-venv.outputs.cache-hit != 'true' }}
- name: Make unbound (if not from cache)
run: make unbound-${{ matrix.python-version }}-github
if: ${{ steps.cache-venv.outputs.cache-hit != 'true' }}
- name: Check linting
run: make check
env:
GITHUB_ACTIONS: True
- name: Run tests
run: make old-test
env:
GITHUB_ACTIONS: True
ENABLE_BATCH: True
SECRET_KEY: Github
DEBUG: True
DB_NAME: internetnl
DB_USER: internetnluser
DB_PASSWORD: internetnluser
- name: Verify if Build API documentation command works (needs /static/ dir to exist)
run: |
mkdir -p static
make manage api_generate_doc