forked from pypi/warehouse
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (108 loc) · 3.55 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
102
103
104
105
106
107
108
name: CI
on:
push:
branches:
- main
pull_request:
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:10.1
ports:
- 5432:5432
name: ${{ matrix.name }}
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Install platform dependencies
run: |
sudo apt -y update
sudo apt -y install libcurl4-openssl-dev libssl-dev pkg-config
- uses: actions/setup-python@v2
if: ${{ matrix.needs-python }}
with:
python-version: 3.9.10
- name: Cache Python dependencies
if: ${{ matrix.needs-python }}
uses: actions/cache@v2
env:
cache-name: warehouse-cache-pip
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt', 'requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-
${{ runner.os }}-${{ github.job }}-
${{ runner.os }}-
- 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
- uses: actions/setup-node@v2
if: ${{ matrix.needs-node }}
with:
node-version: 14.15.5
- name: Cache Node dependencies
if: ${{ matrix.needs-node }}
uses: actions/cache@v2
env:
cache-name: warehouse-cache-npm
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-
${{ runner.os }}-build-${{ github.job }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Node dependencies
if: ${{ matrix.needs-node }}
run: npm ci
- name: Run ${{ matrix.name }}
run: ${{ matrix.command }}