Skip to content

Commit

Permalink
Migrate CI to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
fushar authored and andreyv committed May 4, 2021
1 parent 80091ce commit 5678b3f
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 61 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: ci

on:
- push
- pull_request

jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version:
- 3.8
- 3.6

services:
postgres:
image: postgres:12
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: >-
sudo apt-get install -y
build-essential
php7.4-cli
haskell-platform
fp-compiler
python2.7
cppreference-doc-en-html
cgroup-lite
libcap-dev
python-dev
libpq-dev
libcups2-dev
libyaml-dev
rustc
mono-mcs
- name: Install requirements
run: |
pip install -U pip setuptools wheel
pip install -r requirements.txt
pip install -r dev-requirements.txt
sudo $(which python) prerequisites.py -y --cmsuser=$USER install
python setup.py install
- name: Set up database
env:
PGPASSWORD: postgres
run: |
psql --host=localhost --username=postgres --command="CREATE USER cmsuser WITH PASSWORD 'your_password_here';"
createdb --host=localhost --username=postgres --owner=cmsuser cmsdb
psql --host=localhost --username=postgres --dbname=cmsdb --command='ALTER SCHEMA public OWNER TO cmsuser'
psql --host=localhost --username=postgres --dbname=cmsdb --command='GRANT SELECT ON pg_largeobject TO cmsuser'
createdb --host=localhost --username=postgres --owner=cmsuser cmsdbfortesting
psql --host=localhost --username=postgres --dbname=cmsdbfortesting --command='ALTER SCHEMA public OWNER TO cmsuser'
psql --host=localhost --username=postgres --dbname=cmsdbfortesting --command='GRANT SELECT ON pg_largeobject TO cmsuser'
cp ./config/cms.conf.sample ./config/cms.conf
sed -e "s/\"cmsuser\": \"cmsuser\"/\"cmsuser\": \"$USER\"/" -i ./config/cms.conf
cmsInitDB
- name: Run tests
run: |
cmsRunTests -v --coverage --codecov
59 changes: 0 additions & 59 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contest Management System

Homepage: <http://cms-dev.github.io/>

[![Build Status](https://travis-ci.org/cms-dev/cms.svg?branch=master)](https://travis-ci.org/cms-dev/cms)
[![Build Status](https://github.com/cms-dev/cms/workflows/ci/badge.svg)](https://github.com/cms-dev/cms/actions)
[![codecov](https://codecov.io/gh/cms-dev/cms/branch/master/graph/badge.svg)](https://codecov.io/gh/cms-dev/cms)
[![Join the chat at https://gitter.im/cms-dev/cms](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cms-dev/cms?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Expand Down
2 changes: 1 addition & 1 deletion cmstestsuite/unit_tests/io/rpc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def test_autoreconnect1(self):
self.sleep()
self.assertTrue(client.connected)
self.disconnect_servers()
gevent.sleep(0.01)
gevent.sleep(0.1)
self.assertTrue(client.connected,
"Autoreconnect didn't kick in "
"after server disconnected")
Expand Down

0 comments on commit 5678b3f

Please sign in to comment.