-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (54 loc) · 1.84 KB
/
python-app.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: 'pip'
- name: Install dependencies
run: |
sudo apt update > /dev/null
sudo apt-get -q update
sudo apt-get -q -y install tmux vim libncurses5
python -m pip -q install -U pip virtualenv flake8 pytest build
wget -q https://github.com/FirebirdSQL/firebird/releases/download/R2_5_8/FirebirdCS-2.5.8.27089-0.amd64.tar.gz
tar xzf FirebirdCS-2.5.8.27089-0.amd64.tar.gz
pushd FirebirdCS-2.5.8.27089-0.amd64
tar xzf buildroot.tar.gz
mv opt/firebird /opt
popd
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/firebird/lib" >> "$GITHUB_ENV"
python -m pip -q install -U pip virtualenv
if [ -f requirements.txt ]; then pip -q install -r requirements.txt; fi
- name: Unzip sample db
run: |
src/fb_export.py -h
- name: Export test json data
run: |
src/fb_export.py -d test/employee.fdb -e -o test/json
- name: Run tests with pytest
run: |
pytest
- name: Build dist
run: |
python -m build
- name: Test dist
run: |
pip install dist/fb_export-0.2.0-py3-none-any.whl
fb_export test/employee.fdb
- name: Setup lhotari ssh session on disaster
if: ${{ failure() }}
uses: lhotari/action-upterm@v1