Skip to content

Commit 1c7e773

Browse files
committed
Switched to GitHub Actions CI
1 parent 14efd01 commit 1c7e773

5 files changed

Lines changed: 129 additions & 114 deletions

File tree

.circleci/config.yml

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

.github/workflows/deploy-demo.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy demo
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.8
17+
- uses: actions/cache@v2
18+
name: Configure pip caching
19+
with:
20+
path: ~/.cache/pip
21+
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
22+
restore-keys: |
23+
${{ runner.os }}-pip-
24+
- name: Download database
25+
run: |
26+
curl -O https://github-to-sqlite.dogsheep.net/github.db
27+
- name: Install Python dependencies
28+
run: |
29+
pip install -e .[test]
30+
- name: Generate fixtures.db
31+
run: |
32+
python tests/fixtures.py fixtures.db
33+
- name: Create Metadata
34+
run: |
35+
echo '{
36+
"title": "datasette-graphql demo",
37+
"about": "simonw/datasette-graphql",
38+
"about_url": "https://github.com/simonw/datasette-graphql",
39+
"description_html": "Try it out at <a href=\"/graphql\">/graphql</a>"
40+
}' > metadata.json
41+
- name: Set up Cloud Run
42+
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
43+
with:
44+
version: '275.0.0'
45+
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
46+
service_account_key: ${{ secrets.GCP_SA_KEY }}
47+
- name: Deploy to Cloud Run
48+
run: |-
49+
gcloud config set run/region us-central1
50+
gcloud config set project datasette-222320
51+
datasette publish cloudrun github.db fixtures.db \
52+
-m metadata.json \
53+
--install=https://github.com/simonw/datasette-graphql/archive/$GITHUB_SHA.zip \
54+
--service datasette-graphql-demo

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish Python Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: '3.8'
16+
- uses: actions/cache@v2
17+
name: Configure pip caching
18+
with:
19+
path: ~/.cache/pip
20+
key: ${{ runner.os }}-publish-pip-${{ hashFiles('**/setup.py') }}
21+
restore-keys: |
22+
${{ runner.os }}-publish-pip-
23+
- name: Install dependencies
24+
run: |
25+
pip install -e '.[test]'
26+
pip install setuptools wheel twine
27+
- name: Run tests
28+
run: pytest
29+
- name: Publish
30+
if: success()
31+
env:
32+
TWINE_USERNAME: __token__
33+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
34+
run: |
35+
python setup.py sdist bdist_wheel
36+
twine upload dist/*
37+

.github/workflows/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Test
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: [3.6, 3.7, 3.8]
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python ${{ matrix.python-version }}
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: ${{ matrix.python-version }}
17+
- uses: actions/cache@v2
18+
name: Configure pip caching
19+
with:
20+
path: ~/.cache/pip
21+
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
22+
restore-keys: |
23+
${{ runner.os }}-pip-
24+
- name: Install dependencies
25+
run: |
26+
pip install -e '.[test]'
27+
- name: Run tests
28+
run: |
29+
pytest
30+

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
# sqlite-diffable
22

33
[![PyPI](https://img.shields.io/pypi/v/sqlite-diffable.svg)](https://pypi.org/project/sqlite-diffable/)
4-
[![CircleCI](https://circleci.com/gh/simonw/sqlite-diffable.svg?style=svg)](https://circleci.com/gh/simonw/sqlite-diffable)
5-
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/sqlite-diffable/blob/master/LICENSE)
4+
[![Changelog](https://img.shields.io/github/v/release/simonw/sqlite-diffable?include_prereleases&label=changelog)](https://github.com/simonw/sqlite-diffable/releases)
5+
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/sqlite-diffable/blob/main/LICENSE)
66

77
Tools for dumping/loading a SQLite database to diffable directory structure
88

9+
Installation:
10+
11+
pip install sqlite-diffable
12+
913
Usage:
1014

11-
$ sqlite-diffable dump fixtures.db out/ facetable
15+
sqlite-diffable dump fixtures.db out/ facetable
1216

1317
This dumps the table called `facetable` from `fixtures.db` into the `out/` directory.
1418

1519
To dump out all tables, use `--all`:
1620

17-
$ sqlite-diffable dump fixtures.db out/ --all
21+
sqlite-diffable dump fixtures.db out/ --all

0 commit comments

Comments
 (0)