Skip to content

Commit 0c6ea27

Browse files
authored
Setup CI (#17)
1 parent 612a281 commit 0c6ea27

File tree

4 files changed

+48
-29
lines changed

4 files changed

+48
-29
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
name: dbt-sqlite
3+
4+
on: [push]
5+
6+
jobs:
7+
build:
8+
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: ["3.7", "3.8", "3.9"]
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v3
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install from requirements.txt
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install pytest pytest-dotenv dbt-tests-adapter==1.1.0
24+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
25+
- name: Create data directory and install crypto.so
26+
run: |
27+
mkdir -p /tmp/dbt-sqlite-tests
28+
cd /tmp/dbt-sqlite-tests && wget https://github.com/nalgeon/sqlean/releases/download/0.12.2/crypto.so
29+
- name: Run test script
30+
run: |
31+
./run_tests.sh

Dockerfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,4 @@ RUN pip install dbt-core~=1.1.0
1515

1616
RUN pip install pytest pytest-dotenv dbt-tests-adapter==1.1.0
1717

18-
# dbt-sqlite overrides some stuff pertaining to 'docs generate'
19-
# so exercise it using jaffle_shop repo
20-
21-
RUN cd /root && git clone https://github.com/dbt-labs/jaffle_shop.git
22-
2318
ENTRYPOINT ["./run_tests.sh"]

run_tests.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
echo "HOME=$HOME"
4+
35
pip install -e .
46

57
# Leaving the database file between runs of pytest can mess up subsequent test runs.
@@ -12,15 +14,27 @@ python3 -m pytest tests/functional
1214
# dbt-sqlite overrides some stuff pertaining to 'docs generate'
1315
# so exercise it using jaffle_shop repo
1416

15-
cd /root/jaffle_shop
17+
# dbt-sqlite overrides some stuff pertaining to 'docs generate'
18+
# so exercise it using jaffle_shop repo
19+
20+
cd $HOME
21+
22+
git clone https://github.com/dbt-labs/jaffle_shop.git
23+
24+
cd jaffle_shop
1625

1726
git pull
1827

1928
mkdir -p /tmp/jaffle_shop
2029

21-
mkdir -p /root/.dbt
30+
mkdir -p $HOME/.dbt
31+
32+
if [ -f $HOME/.dbt/profiles.yml ]; then
33+
echo "ERROR: profiles.yml already exists, refusing to overwrite it"
34+
exit 1
35+
fi
2236

23-
cat >> /root/.dbt/profiles.yml <<EOF
37+
cat >> $HOME/.dbt/profiles.yml <<EOF
2438
2539
jaffle_shop:
2640

test/sqlite.dbtspec

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)