-
Notifications
You must be signed in to change notification settings - Fork 3
114 lines (101 loc) · 3.39 KB
/
main.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
109
110
111
112
113
114
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, main, release ]
pull_request:
branches: [ master, main, release ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
test:
env:
REDIS_HOST: localhost
REDIS_PORT: 6379
POSTGRES_DB: zillionare
POSTGRES_HOST: localhost
POSTGRES_USER: zillionare
POSTGRES_PASSWORD: zillionare
POSTGRES_PORT: 5432
JQ_ACCOUNT: "${{secrets.JQ_ACCOUNT}}"
JQ_PASSWORD: ${{secrets.JQ_PASSWORD}}
POSTGRES_ENABLED: true
# The type of runner that the job will run on
strategy:
matrix:
python-versions: [3.8]
os: [ubuntu-18.04, ubuntu-20.04]
runs-on: ${{ matrix.os }}
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
postgres:
image: postgres
env: # this is defined by image postgres
POSTGRES_PASSWORD: zillionare
POSTGRES_USER: zillionare
POSTGRES_DB: zillionare
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-versions }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions poetry
- name: init POSTGRES db
run: |
export TZ=Asia/Shanghai
sudo -E apt-get update
sudo -E apt-get install --yes --no-install-recommends postgresql-client wget
wget https://raw.githubusercontent.com/zillionare/omega/release/omega/config/sql/init.sql -O init.sql
PGPASSWORD=zillionare psql -U zillionare -h localhost --dbname=zillionare --file=init.sql
- name: test with tox
run:
tox
- name: list files
run: ls -l .
- name: pre-publish documentation
run: |
poetry install -E doc
poetry run mkdocs build
- name: publish documentation
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.PERSONAL_TOKEN }}
publish_dir: ./site
- uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
files: coverage.xml
- name: Build wheels and source tarball
run: >-
poetry build
- name: publish to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN}}
repository_url: https://test.pypi.org/legacy/
skip_existing: true