Mercurial > p > roundup > code
comparison .github/workflows/ci-test.yml @ 6858:9309493b70c4
more
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 31 Aug 2022 23:05:18 -0400 |
| parents | a346b5d23480 |
| children | ebdadf3b2653 |
comparison
equal
deleted
inserted
replaced
| 6857:a346b5d23480 | 6858:9309493b70c4 |
|---|---|
| 25 python-version: [ "2.7", "3.10" ] | 25 python-version: [ "2.7", "3.10" ] |
| 26 #python-version: [ "2.7", "3.10", "3.9", "3.8", "3.6" ] | 26 #python-version: [ "2.7", "3.10", "3.9", "3.8", "3.6" ] |
| 27 # use for multiple os or ubuntu versions | 27 # use for multiple os or ubuntu versions |
| 28 # os: [ubuntu-latest, macos-latest, windows-latest] | 28 # os: [ubuntu-latest, macos-latest, windows-latest] |
| 29 | 29 |
| 30 #env: | 30 env: |
| 31 # OS: ${{ matrix.os }} | 31 # OS: ${{ matrix.os }} |
| 32 # PYTHON: ${{ matrix.python-version }} | 32 PYTHON_VERSION: ${{ matrix.python-version }} |
| 33 | 33 |
| 34 steps: | 34 steps: |
| 35 # Checkout the latest code from the repo | 35 # Checkout the latest code from the repo |
| 36 - name: Checkout source | 36 - name: Checkout source |
| 37 uses: actions/checkout@v3 | 37 uses: actions/checkout@v3 |
| 42 with: | 42 with: |
| 43 python-version: ${{ matrix.python-version }} | 43 python-version: ${{ matrix.python-version }} |
| 44 | 44 |
| 45 # Display the Python version being used | 45 # Display the Python version being used |
| 46 - name: Display Python version | 46 - name: Display Python version |
| 47 run: python -c "import sys; print(sys.version)" | 47 run: python -c "import sys; print(sys.version)"; echo $PYTHON_VERSION |
| 48 | 48 |
| 49 # Install the databases | 49 # Install the databases |
| 50 - name: Install postgres | 50 - name: Install postgres |
| 51 if: ${{ false }} | |
| 52 run: | | 51 run: | |
| 53 sudo apt-get install postgresql | 52 sudo apt-get install postgresql |
| 54 # Disable fsync for speed, don't care about data durability when testing | 53 # Disable fsync for speed, don't care about data durability when testing |
| 55 sudo sed -i -e '$a\fsync = off' /etc/postgresql/*/*/postgresql.conf | 54 sudo sed -i -e '$a\fsync = off' /etc/postgresql/*/*/postgresql.conf |
| 56 sudo service postgresql restart; sleep 30 | 55 sudo service postgresql restart; sleep 30 |
| 71 # plus others. Otherwise we get: | 70 # plus others. Otherwise we get: |
| 72 # COLLATION 'utf8_bin' is not valid for CHARACTER SET 'utf8mb4' | 71 # COLLATION 'utf8_bin' is not valid for CHARACTER SET 'utf8mb4' |
| 73 # sed -i 's/CREATE DATABASE \%s/CREATE DATABASE \%s COLLATE utf8_general_ci/' roundup/backends/back_mysql.py | 72 # sed -i 's/CREATE DATABASE \%s/CREATE DATABASE \%s COLLATE utf8_general_ci/' roundup/backends/back_mysql.py |
| 74 | 73 |
| 75 - name: Update pip | 74 - name: Update pip |
| 76 if: ${{ false }} | |
| 77 run: python -m pip install --upgrade pip | 75 run: python -m pip install --upgrade pip |
| 78 | 76 |
| 79 - name: Install db libraries | 77 - name: Install db libraries |
| 80 if: ${{ false }} | |
| 81 run: pip install psycopg2 mysqlclient | 78 run: pip install psycopg2 mysqlclient |
| 82 | 79 |
| 83 - name: Install auxilary packages | 80 - name: Install auxilary packages |
| 84 run: | | 81 run: | |
| 85 sudo apt-get install swig gpgsm libgpgme-dev | 82 sudo apt-get install swig gpgsm libgpgme-dev |
| 113 # The GitHub editor is 127 chars wide | 110 # The GitHub editor is 127 chars wide |
| 114 flake8 roundup --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | 111 flake8 roundup --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 115 | 112 |
| 116 # Run the tests using pytest with test files in tests directory. | 113 # Run the tests using pytest with test files in tests directory. |
| 117 - name: Run tests | 114 - name: Run tests |
| 118 run: pytest -v tests | 115 run: | |
| 116 if [[ $(python -c 'import sys; print("%d.%d.%d"%(sys.version_info.major, sys.version_info.minor, sys.version_info.micro))') != "2."* ]]; then | |
| 117 pytest -r a \ | |
| 118 -W default \ | |
| 119 -W "ignore:SelectableGroups:DeprecationWarning" \ | |
| 120 -W "ignore:the imp module:DeprecationWarning:gpg.gpgme:15" \ | |
| 121 -W "ignore:'U' mode::docutils.io" \ | |
| 122 -W "ignore:unclosed:ResourceWarning:roundup.roundup.demo" \ | |
| 123 -W "ignore:unclosed file:ResourceWarning:enum" \ | |
| 124 -v --maxfail=5 test/ --cov=roundup | |
| 125 else | |
| 126 # python2 case | |
| 127 pytest -v -r a --maxfail=5 test/ --cov=roundup | |
| 128 fi | |
| 119 | 129 |
| 120 - name: Upload coverage to Codecov | 130 - name: Upload coverage to Codecov |
| 121 # see: https://github.com/codecov/codecov-action#usage | 131 # see: https://github.com/codecov/codecov-action#usage |
| 122 uses: codecov/codecov-action@v3 | 132 uses: codecov/codecov-action@v3 |
| 123 with: | 133 with: |
