Skip to content

Commit c77b991

Browse files
Update deploy.yaml
Testing workflow
1 parent c0863f1 commit c77b991

File tree

1 file changed

+37
-52
lines changed

1 file changed

+37
-52
lines changed

.github/workflows/deploy.yaml

Lines changed: 37 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,51 @@
1-
name: Deploy
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
23

3-
on:
4-
push:
5-
branches:
6-
- 'main'
7-
- 'develop'
8-
pull_request:
9-
branches:
10-
- 'main'
11-
- 'develop'
12-
schedule:
13-
- cron: '30 1 * * *'
4+
name: Test and Release
145

6+
on:
7+
push:
8+
pull_request:
9+
workflow_dispatch:
1510

1611
jobs:
1712
tests:
1813
runs-on: ubuntu-latest
19-
steps:
20-
- name: check out lib
21-
uses: actions/checkout@v4
22-
with:
23-
repository: 'sqlitecloud/sdk'
24-
path: 'sdk'
25-
- name: build lib
26-
run: |
27-
mkdir LibreSSL
28-
cd LibreSSL
29-
wget https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.8.1.tar.gz
30-
tar xzf libressl-3.8.1.tar.gz
31-
cd libressl-3.8.1
32-
sudo ./configure --prefix=/usr/local/ --with-openssldir=/usr/local/
33-
sudo make install
34-
echo "libre ssl COMPLETED"
35-
ls -la /usr/local/lib/
36-
cd ../..
37-
cd sdk/C
38-
sudo make libsqcloud.so
39-
- uses: actions/checkout@v4
40-
with:
41-
path: 'pysqlcloud'
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: ["3.6", "3.12"]
4218

43-
- name: Install dependencies
44-
run: |
45-
cd pysqlcloud
46-
python -m pip install -r requirements.txt
47-
python -m pip install -r requirements-dev.txt
48-
- name: Linting and Testing
49-
env:
50-
TEST_CONNECTION_URL: ${{secrets.TEST_CONNECTION_URL}}
51-
SQLITECLOUD_DRIVER_PATH: ${{github.workspace}}/sdk/C/libsqcloud.so
52-
LD_LIBRARY_PATH: /usr/local/lib/
53-
run: |
54-
cd pysqlcloud
55-
ls -la $SQLITECLOUD_DRIVER_PATH
56-
export PYTHONPATH=$PYTHONPATH:$(pwd)/src
57-
make lint
58-
make test
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v3
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install -r requirements.txt
28+
python -m pip install -r requirements-dev.txt
29+
- name: Lint
30+
run: |
31+
flake8 . --count --exit-zero --show-source --statistics
32+
isort --diff --check-only src
33+
- name: Tests
34+
env:
35+
SQLITE_CONNECTION_STRING: ${{ secrets.SQLITE_CONNECTION_STRING }}
36+
SQLITE_USER: ${{ secrets.SQLITE_USER }}
37+
SQLITE_PASSWORD: ${{ secrets.SQLITE_PASSWORD }}
38+
SQLITE_API_KEY: ${{ secrets.SQLITE_API_KEY }}
39+
SQLITE_HOST: ${{ secrets.SQLITE_HOST }}
40+
SQLITE_DB: ${{ secrets.SQLITE_DB }}
41+
SQLITE_PORT: ${{ secrets.SQLITE_PORT }}
42+
run: |
43+
pytest -v src/tests
5944
6045
release:
6146
if: ${{ github.ref == 'refs/heads/main' }}
6247
needs: tests
63-
name: Release
48+
name: Release
6449
runs-on: ubuntu-latest
6550
steps:
6651
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)