Mercurial > p > roundup > code
annotate .github/workflows/ci-test.yml @ 7260:e07e96ef188b
Bump codecov/codecov-action from 3.1.1 to 3.1.2 - https://github.com/roundup-tracker/roundup/pull/18
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 19 Apr 2023 21:35:48 -0400 |
| parents | be61a4bc69ff |
| children | 0ca12df8ef06 |
| rev | line source |
|---|---|
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
1 # merged in python-package.yml workflow |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
2 |
|
7055
83dc71b3211f
add web references used to build github ci file.
John Rouillard <rouilj@ieee.org>
parents:
6955
diff
changeset
|
3 # reference docs: |
|
83dc71b3211f
add web references used to build github ci file.
John Rouillard <rouilj@ieee.org>
parents:
6955
diff
changeset
|
4 # https://blog.deepjyoti30.dev/tests-github-python |
|
83dc71b3211f
add web references used to build github ci file.
John Rouillard <rouilj@ieee.org>
parents:
6955
diff
changeset
|
5 # https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python |
| 7097 | 6 # https://github.com/pypa/twine/blob/main/.github/workflows/main.yml |
| 7 | |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
8 name: roundup-ci |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
9 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
10 on: |
|
6887
dc7b886c42e4
run on any branch push except maint-1.6
John Rouillard <rouilj@ieee.org>
parents:
6886
diff
changeset
|
11 push: |
|
6904
92b64fd3341f
cleanup, comments ready for production.
John Rouillard <rouilj@ieee.org>
parents:
6903
diff
changeset
|
12 # skip if github.ref is 'refs/heads/maint-1.6' |
|
92b64fd3341f
cleanup, comments ready for production.
John Rouillard <rouilj@ieee.org>
parents:
6903
diff
changeset
|
13 # aka github.ref_name of 'maint-1.6' |
|
92b64fd3341f
cleanup, comments ready for production.
John Rouillard <rouilj@ieee.org>
parents:
6903
diff
changeset
|
14 # see https://github.com/orgs/community/discussions/26253 |
|
92b64fd3341f
cleanup, comments ready for production.
John Rouillard <rouilj@ieee.org>
parents:
6903
diff
changeset
|
15 # for mechanism to control matrix based on branch |
|
6887
dc7b886c42e4
run on any branch push except maint-1.6
John Rouillard <rouilj@ieee.org>
parents:
6886
diff
changeset
|
16 branches: [ "*", '!maint-1.6' ] |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
17 # pull_request: |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
18 # branches: [ "master" ] |
|
6880
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
19 schedule: |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
20 # monthly build/check |
|
6885
cc9bd0dd39fc
change time again. also build on all pushes
John Rouillard <rouilj@ieee.org>
parents:
6884
diff
changeset
|
21 - cron: '23 17 1 * *' |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
22 |
|
6914
6010c20dc104
add mock package for testing
John Rouillard <rouilj@ieee.org>
parents:
6904
diff
changeset
|
23 # GITHUB_TOKEN only has read repo context. |
|
6010c20dc104
add mock package for testing
John Rouillard <rouilj@ieee.org>
parents:
6904
diff
changeset
|
24 permissions: |
|
6010c20dc104
add mock package for testing
John Rouillard <rouilj@ieee.org>
parents:
6904
diff
changeset
|
25 contents: read |
|
6010c20dc104
add mock package for testing
John Rouillard <rouilj@ieee.org>
parents:
6904
diff
changeset
|
26 |
|
6953
301f352b5d63
Only do one build at a time. Cancel older in progress builds.
John Rouillard <rouilj@ieee.org>
parents:
6952
diff
changeset
|
27 concurrency: |
|
301f352b5d63
Only do one build at a time. Cancel older in progress builds.
John Rouillard <rouilj@ieee.org>
parents:
6952
diff
changeset
|
28 group: ${{ github.workflow }}-${{ github.ref }} |
| 6954 | 29 cancel-in-progress: true |
|
6953
301f352b5d63
Only do one build at a time. Cancel older in progress builds.
John Rouillard <rouilj@ieee.org>
parents:
6952
diff
changeset
|
30 |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
31 jobs: |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
32 test: |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
33 name: CI build test |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
34 |
|
6952
4eea63155cff
enable all tests, make test job failure stil run final job.
John Rouillard <rouilj@ieee.org>
parents:
6951
diff
changeset
|
35 # run the finalizer for coveralls even if one or more |
|
4eea63155cff
enable all tests, make test job failure stil run final job.
John Rouillard <rouilj@ieee.org>
parents:
6951
diff
changeset
|
36 # matrix runs fail. |
|
4eea63155cff
enable all tests, make test job failure stil run final job.
John Rouillard <rouilj@ieee.org>
parents:
6951
diff
changeset
|
37 continue-on-error: true |
|
4eea63155cff
enable all tests, make test job failure stil run final job.
John Rouillard <rouilj@ieee.org>
parents:
6951
diff
changeset
|
38 |
|
6891
be310c5f866e
another trial with exclude and include
John Rouillard <rouilj@ieee.org>
parents:
6890
diff
changeset
|
39 #runs-on: ubuntu-latest |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
40 # use below if running on multiple OS's. |
|
6891
be310c5f866e
another trial with exclude and include
John Rouillard <rouilj@ieee.org>
parents:
6890
diff
changeset
|
41 runs-on: ${{ matrix.os }} |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
42 |
|
7194
8dc5b3739367
Prevent github actions from running if commit includes 'no-github-ci'
John Rouillard <rouilj@ieee.org>
parents:
7187
diff
changeset
|
43 if: "!contains(github.event.head_commit.message, 'no-github-ci')" |
|
8dc5b3739367
Prevent github actions from running if commit includes 'no-github-ci'
John Rouillard <rouilj@ieee.org>
parents:
7187
diff
changeset
|
44 |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
45 strategy: |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
46 fail-fast: false |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
47 max-parallel: 4 |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
48 matrix: |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
49 # Run in all these versions of Python |
|
7107
8e2219abbde3
infra: support new ubuntu 22.04 runners.
John Rouillard <rouilj@ieee.org>
parents:
7105
diff
changeset
|
50 python-version: |
|
8e2219abbde3
infra: support new ubuntu 22.04 runners.
John Rouillard <rouilj@ieee.org>
parents:
7105
diff
changeset
|
51 - "2.7" |
|
8e2219abbde3
infra: support new ubuntu 22.04 runners.
John Rouillard <rouilj@ieee.org>
parents:
7105
diff
changeset
|
52 - "3.10" |
|
7130
890b55c374a3
Remove 3.9, 3.11-dev and 3.7 test versions
John Rouillard <rouilj@ieee.org>
parents:
7107
diff
changeset
|
53 # - "3.9" |
|
7107
8e2219abbde3
infra: support new ubuntu 22.04 runners.
John Rouillard <rouilj@ieee.org>
parents:
7105
diff
changeset
|
54 - "3.8" |
|
7130
890b55c374a3
Remove 3.9, 3.11-dev and 3.7 test versions
John Rouillard <rouilj@ieee.org>
parents:
7107
diff
changeset
|
55 # - "3.7" |
|
7107
8e2219abbde3
infra: support new ubuntu 22.04 runners.
John Rouillard <rouilj@ieee.org>
parents:
7105
diff
changeset
|
56 - "3.11" |
|
6904
92b64fd3341f
cleanup, comments ready for production.
John Rouillard <rouilj@ieee.org>
parents:
6903
diff
changeset
|
57 |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
58 # use for multiple os or ubuntu versions |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
59 #os: [ubuntu-latest, macos-latest, windows-latest] |
|
7107
8e2219abbde3
infra: support new ubuntu 22.04 runners.
John Rouillard <rouilj@ieee.org>
parents:
7105
diff
changeset
|
60 # ubuntu latest 22.04 12/2022 |
|
8e2219abbde3
infra: support new ubuntu 22.04 runners.
John Rouillard <rouilj@ieee.org>
parents:
7105
diff
changeset
|
61 os: [ubuntu-latest, ubuntu-20.04] |
|
6904
92b64fd3341f
cleanup, comments ready for production.
John Rouillard <rouilj@ieee.org>
parents:
6903
diff
changeset
|
62 |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
63 # if the ones above fail. fail the build |
|
6877
ac2b8a8f5727
fix mysql SQL to create user and grant. set max jobs in parallel
John Rouillard <rouilj@ieee.org>
parents:
6876
diff
changeset
|
64 experimental: [false] |
|
6904
92b64fd3341f
cleanup, comments ready for production.
John Rouillard <rouilj@ieee.org>
parents:
6903
diff
changeset
|
65 |
|
6888
f4705aba3503
add ubuntu-22.04 for 3.10 and 3.8
John Rouillard <rouilj@ieee.org>
parents:
6887
diff
changeset
|
66 include: |
| 7103 | 67 # example: if 3.12 fails the jobs still succeeds |
|
7107
8e2219abbde3
infra: support new ubuntu 22.04 runners.
John Rouillard <rouilj@ieee.org>
parents:
7105
diff
changeset
|
68 - python-version: 3.12-dev |
| 6893 | 69 os: ubuntu-22.04 |
|
6904
92b64fd3341f
cleanup, comments ready for production.
John Rouillard <rouilj@ieee.org>
parents:
6903
diff
changeset
|
70 experimental: [true] |
|
7130
890b55c374a3
Remove 3.9, 3.11-dev and 3.7 test versions
John Rouillard <rouilj@ieee.org>
parents:
7107
diff
changeset
|
71 #- python-version: 3.11-dev |
|
890b55c374a3
Remove 3.9, 3.11-dev and 3.7 test versions
John Rouillard <rouilj@ieee.org>
parents:
7107
diff
changeset
|
72 # os: ubuntu-20.04 |
|
7107
8e2219abbde3
infra: support new ubuntu 22.04 runners.
John Rouillard <rouilj@ieee.org>
parents:
7105
diff
changeset
|
73 # 3.6 not available on new 22.04 runners, so run on 20.04 ubuntu |
|
8e2219abbde3
infra: support new ubuntu 22.04 runners.
John Rouillard <rouilj@ieee.org>
parents:
7105
diff
changeset
|
74 - python-version: 3.6 |
|
8e2219abbde3
infra: support new ubuntu 22.04 runners.
John Rouillard <rouilj@ieee.org>
parents:
7105
diff
changeset
|
75 os: ubuntu-20.04 |
|
6904
92b64fd3341f
cleanup, comments ready for production.
John Rouillard <rouilj@ieee.org>
parents:
6903
diff
changeset
|
76 |
| 6893 | 77 exclude: |
|
7107
8e2219abbde3
infra: support new ubuntu 22.04 runners.
John Rouillard <rouilj@ieee.org>
parents:
7105
diff
changeset
|
78 # skip all python versions on 20.04 except explicitly included |
|
8e2219abbde3
infra: support new ubuntu 22.04 runners.
John Rouillard <rouilj@ieee.org>
parents:
7105
diff
changeset
|
79 - os: ubuntu-20.04 |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
80 |
| 6858 | 81 env: |
|
6864
7e907d97deb6
redis, gpg, more myql debugging
John Rouillard <rouilj@ieee.org>
parents:
6863
diff
changeset
|
82 # get colorized pytest output even without a controlling tty |
|
7e907d97deb6
redis, gpg, more myql debugging
John Rouillard <rouilj@ieee.org>
parents:
6863
diff
changeset
|
83 PYTEST_ADDOPTS: "--color=yes" |
|
6859
ebdadf3b2653
fixes and re-enable mysql.
John Rouillard <rouilj@ieee.org>
parents:
6858
diff
changeset
|
84 # OS: ${{ matrix.os }} |
| 6860 | 85 PYTHON_VERSION: ${{ matrix.python-version }} |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
86 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
87 steps: |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
88 # Checkout the latest code from the repo |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
89 - name: Checkout source |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
90 # example directives: |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
91 # disable step |
| 6873 | 92 # if: {{ false }} |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
93 # continue running if step fails |
| 6874 | 94 # continue-on-error: true |
|
7236
821429f560cd
Bump actions/checkout from 3.4.0 to 3.5.0 - https://github.com/roundup-tracker/roundup/pull/13
John Rouillard <rouilj@ieee.org>
parents:
7232
diff
changeset
|
95 uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
96 |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
97 # Setup version of Python to use |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
98 - name: Set Up Python ${{ matrix.python-version }} |
|
7148
cc49ac11850f
Pin actions by using hashes removing tags like @v2. or @master
John Rouillard <rouilj@ieee.org>
parents:
7130
diff
changeset
|
99 uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
100 with: |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
101 python-version: ${{ matrix.python-version }} |
| 6879 | 102 cache: 'pip' |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
103 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
104 # Display the Python version being used |
|
6920
b3fb615b81c4
get info about sqlite version
John Rouillard <rouilj@ieee.org>
parents:
6919
diff
changeset
|
105 - name: Display Python and key module versions |
|
b3fb615b81c4
get info about sqlite version
John Rouillard <rouilj@ieee.org>
parents:
6919
diff
changeset
|
106 run: | |
|
b3fb615b81c4
get info about sqlite version
John Rouillard <rouilj@ieee.org>
parents:
6919
diff
changeset
|
107 python -c "import sys; print('python version: ', sys.version)" |
| 6924 | 108 python -c "import sqlite3; print('sqlite3 version, sqlite version: ', sqlite3.version, sqlite3.sqlite_version)" |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
109 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
110 # Install the databases |
| 6852 | 111 - name: Install mysql/mariadb |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
112 run: | |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
113 #set -xv |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
114 # mysql is pre-installed and active but this is the install command |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
115 # sudo apt-get install mysql-server mysql-client |
|
6841
3671c0f6352e
More fixes to yaml using linter:
John Rouillard <rouilj@ieee.org>
parents:
6840
diff
changeset
|
116 # set up mysql database |
|
6870
b040642efae3
mysql sleep and more debug
John Rouillard <rouilj@ieee.org>
parents:
6869
diff
changeset
|
117 sudo sed -i -e '/^\[mysqld\]/,/^\[mysql/s/^#* *max_allowed_packet.*/max_allowed_packet = 500M/' /etc/mysql/mysql.conf.d/mysqld.cnf; sleep 3 |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
118 #tail -n +0 /etc/mysql/my.cnf /etc/mysql/mysql.conf.d/mysqld.cnf |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
119 #grep max_allowed /etc/mysql/mysql.conf.d/mysqld.cnf |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
120 #ls /etc/mysql/conf.d/ /etc/mysql/mysql.conf.d/ |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
121 #sleep 5 |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
122 sudo service mysql restart |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
123 #sleep 10 |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
124 #ps -ef | grep mysqld |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
125 #sudo netstat -anp | grep mysqld |
|
6877
ac2b8a8f5727
fix mysql SQL to create user and grant. set max jobs in parallel
John Rouillard <rouilj@ieee.org>
parents:
6876
diff
changeset
|
126 sudo mysql -u root -proot -e 'CREATE USER "rounduptest"@"localhost" IDENTIFIED WITH mysql_native_password BY "rounduptest"; GRANT ALL on rounduptest.* TO "rounduptest"@"localhost";' |
| 6873 | 127 |
| 128 - name: Install postgres | |
| 129 run: | | |
| 130 sudo apt-get install postgresql | |
| 6875 | 131 # Disable fsync for speed, don't care about data durability |
| 132 # when testing | |
| 6873 | 133 sudo sed -i -e '$a\fsync = off' /etc/postgresql/*/*/postgresql.conf |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
134 sudo service postgresql restart; sleep 10 |
| 6873 | 135 # set up postgresql database |
| 136 sudo -u postgres psql -c "CREATE ROLE rounduptest WITH CREATEDB LOGIN PASSWORD 'rounduptest';" -U postgres | |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
137 |
|
6864
7e907d97deb6
redis, gpg, more myql debugging
John Rouillard <rouilj@ieee.org>
parents:
6863
diff
changeset
|
138 - name: install redis |
|
6865
e69b4bfaccd3
pip redis in, fix markdown2 test, install ReST, mysql edit
John Rouillard <rouilj@ieee.org>
parents:
6864
diff
changeset
|
139 run: | |
|
e69b4bfaccd3
pip redis in, fix markdown2 test, install ReST, mysql edit
John Rouillard <rouilj@ieee.org>
parents:
6864
diff
changeset
|
140 sudo apt-get install redis |
|
e69b4bfaccd3
pip redis in, fix markdown2 test, install ReST, mysql edit
John Rouillard <rouilj@ieee.org>
parents:
6864
diff
changeset
|
141 pip install redis |
|
6864
7e907d97deb6
redis, gpg, more myql debugging
John Rouillard <rouilj@ieee.org>
parents:
6863
diff
changeset
|
142 |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
143 - name: Update pip |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
144 run: python -m pip install --upgrade pip |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
145 |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
146 - name: Install python db libraries |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
147 run: pip install psycopg2 mysqlclient |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
148 |
|
6865
e69b4bfaccd3
pip redis in, fix markdown2 test, install ReST, mysql edit
John Rouillard <rouilj@ieee.org>
parents:
6864
diff
changeset
|
149 - name: Install auxiliary packages |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
150 run: | |
|
6850
ce3f39195a68
updates and remove tab from yml.
John Rouillard <rouilj@ieee.org>
parents:
6849
diff
changeset
|
151 sudo apt-get install swig gpgsm libgpgme-dev |
|
6865
e69b4bfaccd3
pip redis in, fix markdown2 test, install ReST, mysql edit
John Rouillard <rouilj@ieee.org>
parents:
6864
diff
changeset
|
152 # pygments for markdown2 to highlight code blocks |
|
e69b4bfaccd3
pip redis in, fix markdown2 test, install ReST, mysql edit
John Rouillard <rouilj@ieee.org>
parents:
6864
diff
changeset
|
153 pip install markdown2 pygments |
|
e69b4bfaccd3
pip redis in, fix markdown2 test, install ReST, mysql edit
John Rouillard <rouilj@ieee.org>
parents:
6864
diff
changeset
|
154 # docutils for ReStructuredText |
|
6866
a3ad2d1a4ea1
spec mistune version; force socket on mysql invocation
John Rouillard <rouilj@ieee.org>
parents:
6865
diff
changeset
|
155 pip install beautifulsoup4 brotli docutils gpg jinja2 \ |
|
a3ad2d1a4ea1
spec mistune version; force socket on mysql invocation
John Rouillard <rouilj@ieee.org>
parents:
6865
diff
changeset
|
156 mistune==0.8.4 pyjwt pytz whoosh |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
157 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
158 - name: Install aux packages that need versions differences |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
159 # if zstd fails install, keep going with test, don't abort |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
160 run: | |
|
6842
d8d4600c49eb
More fixes to yaml using linter:
John Rouillard <rouilj@ieee.org>
parents:
6841
diff
changeset
|
161 set -xv |
| 6840 | 162 pip install zstd || true |
|
6861
097578791f7b
mysql verbose and remove -u
John Rouillard <rouilj@ieee.org>
parents:
6860
diff
changeset
|
163 if [[ "$PYTHON_VERSION" != "2."* ]]; then |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
164 pip install Markdown; fi |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
165 |
| 6867 | 166 - name: Install xapian |
| 167 run: | | |
| 168 sudo apt-get install libxapian-dev | |
| 169 # Sphinx required to build the xapian python bindings. Use 1.8.5 on | |
| 170 # older python and newest on newer. | |
| 171 if [[ $PYTHON_VERSION == "2."* ]]; then pip install sphinx==1.8.5; fi | |
| 172 if [[ $PYTHON_VERSION == '3.'* ]] ; then pip install sphinx; fi | |
| 173 XAPIAN_VER=$(dpkg -l libxapian-dev | tail -n 1 | awk '{print $3}' | cut -d '-' -f 1); echo $XAPIAN_VER | |
| 174 cd /tmp | |
| 175 curl -s -O https://oligarchy.co.uk/xapian/$XAPIAN_VER/xapian-bindings-$XAPIAN_VER.tar.xz | |
| 176 tar -Jxvf xapian-bindings-$XAPIAN_VER.tar.xz | |
| 177 cd xapian-bindings-$XAPIAN_VER/ | |
| 178 if [[ $PYTHON_VERSION == "2."* ]]; then ./configure --prefix=$VIRTUAL_ENV --with-python --disable-documentation; fi | |
| 179 # edit the configure script. | |
| 180 # distutils.sysconfig.get_config_vars('SO') doesn't work for | |
| 181 # 3.11 or newer. | |
| 182 # Change distutils.sysconfig... to just sysconfig and SO | |
| 183 # to EXT_SUFFIX to get valid value. | |
| 184 if [[ $PYTHON_VERSION == "3."* ]]; then sed -i -e '/PYTHON3_SO=/s/distutils\.//g' -e '/PYTHON3_SO=/s/"SO"/"EXT_SUFFIX"/g' configure; ./configure --prefix=$VIRTUAL_ENV --with-python3 --disable-documentation; fi | |
|
6868
5aee1b6ffb52
sudo make install; add 3.11 python.
John Rouillard <rouilj@ieee.org>
parents:
6867
diff
changeset
|
185 case "$PYTHON_VERSION" in nightly) echo skipping xapian build;; *) make && sudo make install; esac |
| 6867 | 186 |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
187 - name: Install pytest and other packages needed for running tests |
|
7255
be61a4bc69ff
remove python codecov - it's depricated, pypi entry removed. codecov uploader is step in job that I hope works
John Rouillard <rouilj@ieee.org>
parents:
7236
diff
changeset
|
188 run: pip install flake8 mock pytest pytest-cov requests |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
189 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
190 - name: Test build roundup and install locale so lang tests work. |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
191 run: | |
| 6855 | 192 sudo apt-get install gettext |
|
6854
4f115313e262
install gettext for locale
John Rouillard <rouilj@ieee.org>
parents:
6853
diff
changeset
|
193 python setup.py build |
| 6840 | 194 (cd locale; make local_install; ls -lR locale/de/LC_MESSAGES) |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
195 |
|
6843
c61ab02ad067
fix syntax error name can not include :
John Rouillard <rouilj@ieee.org>
parents:
6842
diff
changeset
|
196 - name: run flake8 - abort for syntax error, otherwise warn only |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
197 run: | |
| 6840 | 198 # stop the build for Python syntax errors or undefined names |
| 6857 | 199 # talgettext is a utility function ignore it. |
| 200 flake8 roundup --count --select=E9,F63,F7,F82 --show-source --statistics --extend-exclude talgettext.py | |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
201 # exit-zero treats all errors as warnings. |
| 6840 | 202 # The GitHub editor is 127 chars wide |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
203 flake8 roundup --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
204 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
205 # Run the tests using pytest with test files in tests directory. |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
206 - name: Run tests |
| 6858 | 207 run: | |
|
6861
097578791f7b
mysql verbose and remove -u
John Rouillard <rouilj@ieee.org>
parents:
6860
diff
changeset
|
208 if [[ "$PYTHON_VERSION" != "2."* ]]; then |
| 6858 | 209 pytest -r a \ |
|
7169
5cbe5f2a636b
Add --durations=20 for detecting perf changes.
John Rouillard <rouilj@ieee.org>
parents:
7148
diff
changeset
|
210 --durations=20 \ |
| 6858 | 211 -W default \ |
| 212 -W "ignore:SelectableGroups:DeprecationWarning" \ | |
| 213 -W "ignore:the imp module:DeprecationWarning:gpg.gpgme:15" \ | |
| 214 -W "ignore:'U' mode::docutils.io" \ | |
| 215 -W "ignore:unclosed:ResourceWarning:roundup.roundup.demo" \ | |
| 216 -W "ignore:unclosed file:ResourceWarning:enum" \ | |
|
6952
4eea63155cff
enable all tests, make test job failure stil run final job.
John Rouillard <rouilj@ieee.org>
parents:
6951
diff
changeset
|
217 -v test/ --cov=roundup |
|
6951
31c56e8dfefb
3.6 python doesn't support lcov format either.
John Rouillard <rouilj@ieee.org>
parents:
6950
diff
changeset
|
218 if [[ "$PYTHON_VERSION" != "3.6" ]]; then |
|
31c56e8dfefb
3.6 python doesn't support lcov format either.
John Rouillard <rouilj@ieee.org>
parents:
6950
diff
changeset
|
219 # coverage before 3.6 doesn't support lcov output |
|
31c56e8dfefb
3.6 python doesn't support lcov format either.
John Rouillard <rouilj@ieee.org>
parents:
6950
diff
changeset
|
220 coverage lcov |
|
31c56e8dfefb
3.6 python doesn't support lcov format either.
John Rouillard <rouilj@ieee.org>
parents:
6950
diff
changeset
|
221 fi |
| 6858 | 222 else |
| 223 # python2 case | |
|
7171
4e3abaa16296
add duration reporting for python2 as well.
John Rouillard <rouilj@ieee.org>
parents:
7169
diff
changeset
|
224 pytest -v -r a --durations=20 test/ --cov=roundup |
| 6858 | 225 fi |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
226 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
227 - name: Upload coverage to Codecov |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
228 # see: https://github.com/codecov/codecov-action#usage |
|
7260
e07e96ef188b
Bump codecov/codecov-action from 3.1.1 to 3.1.2 - https://github.com/roundup-tracker/roundup/pull/18
John Rouillard <rouilj@ieee.org>
parents:
7255
diff
changeset
|
229 uses: codecov/codecov-action@40a12dcee2df644d47232dde008099a3e9e4f865 # v3.1.2 |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
230 with: |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
231 verbose: true |
| 6881 | 232 token: ${{ secrets.CODECOV_TOKEN }} |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
233 |
| 6945 | 234 - name: Upload coverage to Coveralls |
|
6951
31c56e8dfefb
3.6 python doesn't support lcov format either.
John Rouillard <rouilj@ieee.org>
parents:
6950
diff
changeset
|
235 # python 2.7 and 3.6 versions of coverage can't produce lcov files. |
|
31c56e8dfefb
3.6 python doesn't support lcov format either.
John Rouillard <rouilj@ieee.org>
parents:
6950
diff
changeset
|
236 if: matrix.python-version != '2.7' && matrix.python-version != '3.6' |
|
7232
b650008b5472
Bump coverallsapp/github-action from 1.2.4 to 2.0.0 -- https://github.com/roundup-tracker/roundup/pull/10
John Rouillard <rouilj@ieee.org>
parents:
7231
diff
changeset
|
237 uses: coverallsapp/github-action@67662d24394fd74bffcf7b462d1b432814159afd # master |
| 6945 | 238 with: |
| 239 github-token: ${{ secrets.GITHUB_TOKEN }} | |
|
6948
078073f7d207
coveralls for 3.x only, add paralle unique build key
John Rouillard <rouilj@ieee.org>
parents:
6947
diff
changeset
|
240 path-to-lcov: coverage.lcov |
|
078073f7d207
coveralls for 3.x only, add paralle unique build key
John Rouillard <rouilj@ieee.org>
parents:
6947
diff
changeset
|
241 parallel: run-{{ matrix.python-version }}-{{ matrix.os }} |
|
6943
3b081f5c8fc2
add coveralls as codecov is severly broken.
John Rouillard <rouilj@ieee.org>
parents:
6924
diff
changeset
|
242 |
| 6945 | 243 - name: test build_doc |
| 6946 | 244 run: | |
| 245 python ./setup.py build_doc | |
|
6880
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
246 |
| 6893 | 247 #- name: test docker build current version ubuntu-latest |
|
6904
92b64fd3341f
cleanup, comments ready for production.
John Rouillard <rouilj@ieee.org>
parents:
6903
diff
changeset
|
248 # if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest' |
|
6880
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
249 # run: | |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
250 # docker build -t roundup-app-dev -f scripts/Docker/Dockerfile . |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
251 # mkdir tracker; chmod 777 tracker |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
252 # docker run -d --rm -p 9017:8080 \ |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
253 # -v $PWD/tracker:/usr/src/app/tracker \ |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
254 # roundup-app-dev:latest demo |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
255 # expect 200 |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
256 # curl --fail http://localhost:9017/demo/ > /dev/null |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
257 |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
258 #- name: test docker build released pip version |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
259 # run: | |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
260 # docker build -t roundup-app-rel --build-arg="source=pypi" \ |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
261 # -f scripts/Docker/Dockerfile . |
|
6943
3b081f5c8fc2
add coveralls as codecov is severly broken.
John Rouillard <rouilj@ieee.org>
parents:
6924
diff
changeset
|
262 |
|
3b081f5c8fc2
add coveralls as codecov is severly broken.
John Rouillard <rouilj@ieee.org>
parents:
6924
diff
changeset
|
263 |
|
3b081f5c8fc2
add coveralls as codecov is severly broken.
John Rouillard <rouilj@ieee.org>
parents:
6924
diff
changeset
|
264 # in parallel build codecov requires a finish step |
| 6945 | 265 finish: |
| 266 needs: test | |
| 267 runs-on: ubuntu-latest | |
|
7194
8dc5b3739367
Prevent github actions from running if commit includes 'no-github-ci'
John Rouillard <rouilj@ieee.org>
parents:
7187
diff
changeset
|
268 |
|
8dc5b3739367
Prevent github actions from running if commit includes 'no-github-ci'
John Rouillard <rouilj@ieee.org>
parents:
7187
diff
changeset
|
269 if: "!contains(github.event.head_commit.message, 'no-github-ci')" |
|
8dc5b3739367
Prevent github actions from running if commit includes 'no-github-ci'
John Rouillard <rouilj@ieee.org>
parents:
7187
diff
changeset
|
270 |
| 6945 | 271 steps: |
| 272 - name: Coveralls Finished | |
|
7232
b650008b5472
Bump coverallsapp/github-action from 1.2.4 to 2.0.0 -- https://github.com/roundup-tracker/roundup/pull/10
John Rouillard <rouilj@ieee.org>
parents:
7231
diff
changeset
|
273 uses: coverallsapp/github-action@67662d24394fd74bffcf7b462d1b432814159afd # master |
| 6945 | 274 with: |
| 275 github-token: ${{ secrets.github_token }} | |
| 276 parallel-finished: true |
