Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
add dockerfile and workflows (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
bh2smith authored Nov 21, 2022
1 parent 86314e7 commit 3ba6a12
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 30 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: deploy

on:
push:
branches: [main]
tags: [v*]

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v2

- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
- uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
35 changes: 35 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: pull request
on:
pull_request:
push:
branches: [ main ]
jobs:
lint-format-types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install Requirements
run: pip install -r requirements/dev.txt
- name: Pylint
run: pylint src/
- name: Black
run: black --check ./
- name: Type Check (mypy)
run: mypy src --strict
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install Requirements
run:
pip install -r requirements/dev.txt
- name: Tests
run: python -m pytest tests
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,13 @@ check:

test:
python -m pytest tests

run:
python -m src.main

build-image:
docker build -t local_dune_sync .

run-local:
make build-image
docker run -v ${PWD}data:/app/data --env-file .env local_dune_sync
17 changes: 5 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,12 @@ Components for syncing off-chain data with Dune Community Sources
# Local Development


1. clone repo
2. Several Makefile commands:
```shell
make install
```
```shell
make check # (runs black, pylint and mypy --strict)
```
```shell
make test # Runs all tests
```
1. Clone Repo `git clone git@github.com:cowprotocol/dune-sync.git`
2. Several Makefile Commands `make XXX`
Key make commands are; `install, check, test`


## Docker
# Docker
### Build
```shell
docker build -t local_dune_sync .
Expand Down
18 changes: 0 additions & 18 deletions requirements.txt

This file was deleted.

0 comments on commit 3ba6a12

Please sign in to comment.