Mercurial > p > roundup > code
annotate .github/workflows/ci-test.yml @ 6892:70d630fddf55
tab again
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Thu, 01 Sep 2022 14:16:21 -0400 |
| parents | be310c5f866e |
| children | d668e2800147 |
| 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 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
3 name: roundup-ci |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
4 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
5 on: |
|
6887
dc7b886c42e4
run on any branch push except maint-1.6
John Rouillard <rouilj@ieee.org>
parents:
6886
diff
changeset
|
6 push: |
|
dc7b886c42e4
run on any branch push except maint-1.6
John Rouillard <rouilj@ieee.org>
parents:
6886
diff
changeset
|
7 branches: [ "*", '!maint-1.6' ] |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
8 # pull_request: |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
9 # branches: [ "master" ] |
|
6880
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
10 schedule: |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
11 # monthly build/check |
|
6885
cc9bd0dd39fc
change time again. also build on all pushes
John Rouillard <rouilj@ieee.org>
parents:
6884
diff
changeset
|
12 - cron: '23 17 1 * *' |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
13 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
14 jobs: |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
15 test: |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
16 name: CI build test |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
17 |
|
6891
be310c5f866e
another trial with exclude and include
John Rouillard <rouilj@ieee.org>
parents:
6890
diff
changeset
|
18 #runs-on: ubuntu-latest |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
19 # 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
|
20 runs-on: ${{ matrix.os }} |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
21 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
22 strategy: |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
23 fail-fast: false |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
24 max-parallel: 4 |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
25 matrix: |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
26 # Run in all these versions of Python |
|
6889
43a1a3404e42
more tests for ubuntu-22.04 and 3.11-dev rather than explicit ver
John Rouillard <rouilj@ieee.org>
parents:
6888
diff
changeset
|
27 python-version: [ "3.10", "3.11-dev" ] |
|
43a1a3404e42
more tests for ubuntu-22.04 and 3.11-dev rather than explicit ver
John Rouillard <rouilj@ieee.org>
parents:
6888
diff
changeset
|
28 # python-version: [ "2.7", "3.10", "3.9", "3.8", "3.6", "3.11-dev" ] |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
29 # use for multiple os or ubuntu versions |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
30 #os: [ubuntu-latest, macos-latest, windows-latest] |
|
6891
be310c5f866e
another trial with exclude and include
John Rouillard <rouilj@ieee.org>
parents:
6890
diff
changeset
|
31 os: [ubuntu-latest, ubuntu-22.04] |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
32 # 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
|
33 experimental: [false] |
|
6888
f4705aba3503
add ubuntu-22.04 for 3.10 and 3.8
John Rouillard <rouilj@ieee.org>
parents:
6887
diff
changeset
|
34 include: |
|
6877
ac2b8a8f5727
fix mysql SQL to create user and grant. set max jobs in parallel
John Rouillard <rouilj@ieee.org>
parents:
6876
diff
changeset
|
35 # example: if 3.12 fails the jobs still succeeds |
|
6886
05b5224bf19e
comment out experimental examle
John Rouillard <rouilj@ieee.org>
parents:
6885
diff
changeset
|
36 # - python-version: 3.12 |
|
05b5224bf19e
comment out experimental examle
John Rouillard <rouilj@ieee.org>
parents:
6885
diff
changeset
|
37 # experimental: true |
|
6891
be310c5f866e
another trial with exclude and include
John Rouillard <rouilj@ieee.org>
parents:
6890
diff
changeset
|
38 - os: ubuntu-22.04 |
|
be310c5f866e
another trial with exclude and include
John Rouillard <rouilj@ieee.org>
parents:
6890
diff
changeset
|
39 python-version: 2.7 |
|
6889
43a1a3404e42
more tests for ubuntu-22.04 and 3.11-dev rather than explicit ver
John Rouillard <rouilj@ieee.org>
parents:
6888
diff
changeset
|
40 experimental: true |
|
6891
be310c5f866e
another trial with exclude and include
John Rouillard <rouilj@ieee.org>
parents:
6890
diff
changeset
|
41 - os: ubuntu-22.04 |
|
be310c5f866e
another trial with exclude and include
John Rouillard <rouilj@ieee.org>
parents:
6890
diff
changeset
|
42 python-version: 3.11-dev |
|
6888
f4705aba3503
add ubuntu-22.04 for 3.10 and 3.8
John Rouillard <rouilj@ieee.org>
parents:
6887
diff
changeset
|
43 experimental: true |
| 6892 | 44 exclude: |
|
6891
be310c5f866e
another trial with exclude and include
John Rouillard <rouilj@ieee.org>
parents:
6890
diff
changeset
|
45 - os: ubuntu-22.04 |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
46 |
| 6858 | 47 env: |
|
6864
7e907d97deb6
redis, gpg, more myql debugging
John Rouillard <rouilj@ieee.org>
parents:
6863
diff
changeset
|
48 # get colorized pytest output even without a controlling tty |
|
7e907d97deb6
redis, gpg, more myql debugging
John Rouillard <rouilj@ieee.org>
parents:
6863
diff
changeset
|
49 PYTEST_ADDOPTS: "--color=yes" |
|
6859
ebdadf3b2653
fixes and re-enable mysql.
John Rouillard <rouilj@ieee.org>
parents:
6858
diff
changeset
|
50 # OS: ${{ matrix.os }} |
| 6860 | 51 PYTHON_VERSION: ${{ matrix.python-version }} |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
52 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
53 steps: |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
54 # Checkout the latest code from the repo |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
55 - name: Checkout source |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
56 # example directives: |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
57 # disable step |
| 6873 | 58 # if: {{ false }} |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
59 # continue running if step fails |
| 6874 | 60 # continue-on-error: true |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
61 uses: actions/checkout@v3 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
62 |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
63 # Setup version of Python to use |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
64 - name: Set Up Python ${{ matrix.python-version }} |
| 6879 | 65 uses: actions/setup-python@v4 |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
66 with: |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
67 python-version: ${{ matrix.python-version }} |
| 6879 | 68 cache: 'pip' |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
69 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
70 # Display the Python version being used |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
71 - name: Display Python version |
|
6861
097578791f7b
mysql verbose and remove -u
John Rouillard <rouilj@ieee.org>
parents:
6860
diff
changeset
|
72 run: python -c "import sys; print(sys.version)" |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
73 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
74 # Install the databases |
| 6852 | 75 - name: Install mysql/mariadb |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
76 run: | |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
77 #set -xv |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
78 # 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
|
79 # 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
|
80 # set up mysql database |
|
6870
b040642efae3
mysql sleep and more debug
John Rouillard <rouilj@ieee.org>
parents:
6869
diff
changeset
|
81 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
|
82 #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
|
83 #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
|
84 #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
|
85 #sleep 5 |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
86 sudo service mysql restart |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
87 #sleep 10 |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
88 #ps -ef | grep mysqld |
|
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
89 #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
|
90 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 | 91 |
| 92 - name: Install postgres | |
| 93 run: | | |
| 94 sudo apt-get install postgresql | |
| 6875 | 95 # Disable fsync for speed, don't care about data durability |
| 96 # when testing | |
| 6873 | 97 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
|
98 sudo service postgresql restart; sleep 10 |
| 6873 | 99 # set up postgresql database |
| 100 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
|
101 |
|
6864
7e907d97deb6
redis, gpg, more myql debugging
John Rouillard <rouilj@ieee.org>
parents:
6863
diff
changeset
|
102 - name: install redis |
|
6865
e69b4bfaccd3
pip redis in, fix markdown2 test, install ReST, mysql edit
John Rouillard <rouilj@ieee.org>
parents:
6864
diff
changeset
|
103 run: | |
|
e69b4bfaccd3
pip redis in, fix markdown2 test, install ReST, mysql edit
John Rouillard <rouilj@ieee.org>
parents:
6864
diff
changeset
|
104 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
|
105 pip install redis |
|
6864
7e907d97deb6
redis, gpg, more myql debugging
John Rouillard <rouilj@ieee.org>
parents:
6863
diff
changeset
|
106 |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
107 - name: Update pip |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
108 run: python -m pip install --upgrade pip |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
109 |
|
6878
81d811b8d45f
set full python version string; other cleanups
John Rouillard <rouilj@ieee.org>
parents:
6877
diff
changeset
|
110 - name: Install python db libraries |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
111 run: pip install psycopg2 mysqlclient |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
112 |
|
6865
e69b4bfaccd3
pip redis in, fix markdown2 test, install ReST, mysql edit
John Rouillard <rouilj@ieee.org>
parents:
6864
diff
changeset
|
113 - name: Install auxiliary packages |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
114 run: | |
|
6850
ce3f39195a68
updates and remove tab from yml.
John Rouillard <rouilj@ieee.org>
parents:
6849
diff
changeset
|
115 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
|
116 # 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
|
117 pip install markdown2 pygments |
|
e69b4bfaccd3
pip redis in, fix markdown2 test, install ReST, mysql edit
John Rouillard <rouilj@ieee.org>
parents:
6864
diff
changeset
|
118 # docutils for ReStructuredText |
|
6866
a3ad2d1a4ea1
spec mistune version; force socket on mysql invocation
John Rouillard <rouilj@ieee.org>
parents:
6865
diff
changeset
|
119 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
|
120 mistune==0.8.4 pyjwt pytz whoosh |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
121 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
122 - name: Install aux packages that need versions differences |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
123 # 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
|
124 run: | |
|
6842
d8d4600c49eb
More fixes to yaml using linter:
John Rouillard <rouilj@ieee.org>
parents:
6841
diff
changeset
|
125 set -xv |
| 6840 | 126 pip install zstd || true |
|
6861
097578791f7b
mysql verbose and remove -u
John Rouillard <rouilj@ieee.org>
parents:
6860
diff
changeset
|
127 if [[ "$PYTHON_VERSION" != "2."* ]]; then |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
128 pip install Markdown; fi |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
129 |
| 6867 | 130 - name: Install xapian |
| 131 run: | | |
| 132 sudo apt-get install libxapian-dev | |
| 133 # Sphinx required to build the xapian python bindings. Use 1.8.5 on | |
| 134 # older python and newest on newer. | |
| 135 if [[ $PYTHON_VERSION == "2."* ]]; then pip install sphinx==1.8.5; fi | |
| 136 if [[ $PYTHON_VERSION == '3.'* ]] ; then pip install sphinx; fi | |
| 137 XAPIAN_VER=$(dpkg -l libxapian-dev | tail -n 1 | awk '{print $3}' | cut -d '-' -f 1); echo $XAPIAN_VER | |
| 138 cd /tmp | |
| 139 curl -s -O https://oligarchy.co.uk/xapian/$XAPIAN_VER/xapian-bindings-$XAPIAN_VER.tar.xz | |
| 140 tar -Jxvf xapian-bindings-$XAPIAN_VER.tar.xz | |
| 141 cd xapian-bindings-$XAPIAN_VER/ | |
| 142 if [[ $PYTHON_VERSION == "2."* ]]; then ./configure --prefix=$VIRTUAL_ENV --with-python --disable-documentation; fi | |
| 143 # edit the configure script. | |
| 144 # distutils.sysconfig.get_config_vars('SO') doesn't work for | |
| 145 # 3.11 or newer. | |
| 146 # Change distutils.sysconfig... to just sysconfig and SO | |
| 147 # to EXT_SUFFIX to get valid value. | |
| 148 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
|
149 case "$PYTHON_VERSION" in nightly) echo skipping xapian build;; *) make && sudo make install; esac |
| 6867 | 150 |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
151 - name: Install pytest and other packages needed for running tests |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
152 run: pip install codecov flake8 pytest pytest-cov requests |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
153 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
154 - 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
|
155 run: | |
| 6855 | 156 sudo apt-get install gettext |
|
6854
4f115313e262
install gettext for locale
John Rouillard <rouilj@ieee.org>
parents:
6853
diff
changeset
|
157 python setup.py build |
| 6840 | 158 (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
|
159 |
|
6843
c61ab02ad067
fix syntax error name can not include :
John Rouillard <rouilj@ieee.org>
parents:
6842
diff
changeset
|
160 - 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
|
161 run: | |
| 6840 | 162 # stop the build for Python syntax errors or undefined names |
| 6857 | 163 # talgettext is a utility function ignore it. |
| 164 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
|
165 # exit-zero treats all errors as warnings. |
| 6840 | 166 # The GitHub editor is 127 chars wide |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
167 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
|
168 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
169 # 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
|
170 - name: Run tests |
| 6858 | 171 run: | |
|
6861
097578791f7b
mysql verbose and remove -u
John Rouillard <rouilj@ieee.org>
parents:
6860
diff
changeset
|
172 if [[ "$PYTHON_VERSION" != "2."* ]]; then |
| 6858 | 173 pytest -r a \ |
| 174 -W default \ | |
| 175 -W "ignore:SelectableGroups:DeprecationWarning" \ | |
| 176 -W "ignore:the imp module:DeprecationWarning:gpg.gpgme:15" \ | |
| 177 -W "ignore:'U' mode::docutils.io" \ | |
| 178 -W "ignore:unclosed:ResourceWarning:roundup.roundup.demo" \ | |
| 179 -W "ignore:unclosed file:ResourceWarning:enum" \ | |
| 180 -v --maxfail=5 test/ --cov=roundup | |
| 181 else | |
| 182 # python2 case | |
| 183 pytest -v -r a --maxfail=5 test/ --cov=roundup | |
| 184 fi | |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
185 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
186 - name: Upload coverage to Codecov |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
187 # see: https://github.com/codecov/codecov-action#usage |
| 6840 | 188 uses: codecov/codecov-action@v3 |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
189 with: |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
190 verbose: true |
| 6881 | 191 token: ${{ secrets.CODECOV_TOKEN }} |
|
6839
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
192 |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
193 - name: test build_doc |
|
6e1a82c3addb
Add GitHub Actions test workflow.
John Rouillard <rouilj@ieee.org>
parents:
diff
changeset
|
194 run: | |
|
6842
d8d4600c49eb
More fixes to yaml using linter:
John Rouillard <rouilj@ieee.org>
parents:
6841
diff
changeset
|
195 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
|
196 |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
197 #- name: test docker build current version |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
198 # run: | |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
199 # 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
|
200 # 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
|
201 # 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
|
202 # -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
|
203 # 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
|
204 # expect 200 |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
205 # 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
|
206 |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
207 #- 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
|
208 # run: | |
|
222e84d12bed
schedule build 7PM on first of month; commented out docker tst
John Rouillard <rouilj@ieee.org>
parents:
6879
diff
changeset
|
209 # 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
|
210 # -f scripts/Docker/Dockerfile . |
