forked from pypi/warehouse
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (101 loc) · 3.21 KB
/
ci.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: CI
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
include:
- name: Tests
command: bin/tests --postgresql-host localhost
needs-python: ${{ true }}
needs-node: ${{ false }}
- name: Lint
command: bin/lint
needs-python: ${{ true }}
needs-node: ${{ false }}
- name: Documentation
command: bin/docs
needs-python: ${{ true }}
needs-node: ${{ false }}
- name: Dependencies
command: bin/github-actions-deps
needs-python: ${{ true }}
needs-node: ${{ false }}
- name: Licenses
command: bin/licenses
needs-python: ${{ true }}
needs-node: ${{ false }}
- name: Translations
command: bin/translations
needs-python: ${{ true }}
needs-node: ${{ false }}
- name: Static Tests
command: bin/static_tests
needs-python: ${{ false }}
needs-node: ${{ true }}
- name: Static Lint
command: bin/static_lint
needs-python: ${{ false }}
needs-node: ${{ true }}
- name: Static Pipeline
command: bin/static_pipeline
needs-python: ${{ false }}
needs-node: ${{ true }}
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14.4
ports:
- 5432:5432
env:
POSTGRES_HOST_AUTH_METHOD: trust # never do this in production!
# Set health checks to wait until postgres has started
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
stripe:
image: stripe/stripe-mock:v0.140.0
ports:
- 12111:12111
name: ${{ matrix.name }}
env:
BILLING_BACKEND: warehouse.subscriptions.services.MockStripeBillingService api_base=http://localhost:12111 api_version=2020-08-27
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Install platform dependencies
run: |
sudo apt -y update
sudo apt -y install libcurl4-openssl-dev libssl-dev pkg-config
- uses: actions/setup-python@v4
if: ${{ matrix.needs-python }}
with:
python-version-file: '.python-version'
cache: 'pip'
cache-dependency-path: |
requirements.txt
requirements/*.txt
- name: Install Python dependencies
if: ${{ matrix.needs-python }}
run: |
pip install -U pip setuptools wheel
pip install -r requirements.txt --no-deps
pip install -r requirements/dev.txt
pip check
- uses: actions/setup-node@v3
if: ${{ matrix.needs-node }}
with:
node-version: 16.17.1
cache: 'npm'
- name: Install Node dependencies
if: ${{ matrix.needs-node }}
run: npm ci
- name: Run ${{ matrix.name }}
run: ${{ matrix.command }}