Skip to content

Commit

Permalink
Merge pull request #2 from cowprotocol/workflows2
Browse files Browse the repository at this point in the history
github workflow for PR
  • Loading branch information
harisang authored Jul 4, 2024
2 parents ec33d3d + f951292 commit 2d1f85f
Show file tree
Hide file tree
Showing 11 changed files with 436 additions and 350 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: deploy

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

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

steps:
- uses: actions/checkout@v3

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

- id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
labels: |
org.opencontainers.image.licenses=MIT OR Apache-2.0
- name: Push Project Image
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- uses: cowprotocol/autodeploy-action@v2
if: ${{ github.ref == 'refs/heads/main' }}
with:
images: ghcr.io/cowprotocol/token-imbalances:main
url: ${{ secrets.AUTODEPLOY_URL }}
token: ${{ secrets.AUTODEPLOY_TOKEN }}
timeout: 600000 # 10 minutes
28 changes: 28 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: pull request
on:
pull_request:
push:
branches: [ main ]
jobs:
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python 3.12
uses: actions/setup-python@v3
with:
python-version: '3.12'
- name: Install Requirements
run:
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Set PYTHONPATH
run: echo "PYTHONPATH=src" >> $GITHUB_ENV
- name: Pylint
run:
pylint --fail-under=8 $(git ls-files '**/*.py')
- name: Black
run:
black --check ./
- name: Type Check (mypy)
run: mypy src
Loading

0 comments on commit 2d1f85f

Please sign in to comment.