Skip to content

Commit

Permalink
fix: update lock files in ci (#190)
Browse files Browse the repository at this point in the history
* fix: update lock files in ci

* fix: format
  • Loading branch information
EvolveArt authored Aug 8, 2024
1 parent 406c23b commit e333fd6
Show file tree
Hide file tree
Showing 11 changed files with 358 additions and 331 deletions.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Bug Report
description: File a bug report
title: "[BUG] <title>"
labels: [ "bug" ]
labels: ["bug"]
body:
- type: textarea
id: what-happened
Expand Down Expand Up @@ -62,5 +62,4 @@ body:
label: Is there an existing issue for this?
options:
- label: I have searched the existing issues and verified no issue exits for this problem.

# Thanks to https://github.com/MarketingPipeline/Awesome-Repo-Template
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ body:
description: Describe the feature(s) you would like to be added.
validations:
required: true

# Thanks to https://github.com/MarketingPipeline/Awesome-Repo-Template
9 changes: 3 additions & 6 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@

Closes #


## Introduced changes
<!-- A brief description of the changes -->


-
-
<!-- A brief description of the changes -->

-
-

##

- [ ] This PR contains breaking changes

<!-- List of all breaking changes -->

142 changes: 54 additions & 88 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -1,93 +1,59 @@
---
name: Task - Build & Push Docker Image

on:
workflow_dispatch:
workflow_call:

env:
PYTHON_VERSION: 3.12.4
DOCKER_REGISTRY: ghcr.io/${{ github.repository }}
name: Task - Build & Push Docker Image

jobs:
build_containers:
strategy:
matrix:
package: [pragma-sdk, price-pusher, vrf-listener, checkpointer, merkle-maker]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
on:
workflow_dispatch:
workflow_call:

- name: Extract package version
run: |
export PACKAGE_VERSION=$(grep 'version = "' ./${{ matrix.package }}/pyproject.toml | grep -m 1 -e '[0-9][0-9a-zA-Z]*[-.a-z0-9]*' -o)
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
echo $PACKAGE_VERSION
env:
PYTHON_VERSION: 3.12.4
DOCKER_REGISTRY: ghcr.io/${{ github.repository }}

- name: Build and push pragma-sdk
if: matrix.package == 'pragma-sdk'
uses: docker/build-push-action@v6
with:
context: .
file: ./${{ matrix.package }}/Dockerfile
push: true
build-args: |
PRAGMA_PACKAGE_VERSION=${{ env.PACKAGE_VERSION }}
target: production
tags: |
${{ env.DOCKER_REGISTRY }}/${{ matrix.package }}:${{ env.PACKAGE_VERSION }}
${{ env.DOCKER_REGISTRY}}/${{ matrix.package }}:latest
jobs:
build_containers:
strategy:
matrix:
package:
[pragma-sdk, price-pusher, vrf-listener, checkpointer, merkle-maker]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push other packages
if: matrix.package != 'pragma-sdk'
uses: docker/build-push-action@v6
with:
context: .
file: ./${{ matrix.package }}/Dockerfile
push: true
tags: |
${{ env.DOCKER_REGISTRY }}/${{ matrix.package }}:${{ env.PACKAGE_VERSION }}
${{ env.DOCKER_REGISTRY}}/${{ matrix.package }}:latest
bump_version:
needs: [build_containers]
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/master')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Commitizen
run: pip install --upgrade Commitizen
- name: Configure Git
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Bump version
run: |
git fetch --tags
cz bump --retry || echo "probably nothing to do"
- name: Push changes
run: |
TAG=$(git tag --points-at HEAD)
if [[ $TAG ]]; then
echo "Version bumped to $TAG"
git push
git push --tags
else
echo "Version NOT bumped"
fi

- name: Extract package version
run: |
export PACKAGE_VERSION=$(grep 'version = "' ./${{ matrix.package }}/pyproject.toml | grep -m 1 -e '[0-9][0-9a-zA-Z]*[-.a-z0-9]*' -o)
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
echo $PACKAGE_VERSION
- name: Build and push pragma-sdk
if: matrix.package == 'pragma-sdk'
uses: docker/build-push-action@v6
with:
context: .
file: ./${{ matrix.package }}/Dockerfile
push: true
build-args: |
PRAGMA_PACKAGE_VERSION=${{ env.PACKAGE_VERSION }}
target: production
tags: |
${{ env.DOCKER_REGISTRY }}/${{ matrix.package }}:${{ env.PACKAGE_VERSION }}
${{ env.DOCKER_REGISTRY}}/${{ matrix.package }}:latest
- name: Build and push other packages
if: matrix.package != 'pragma-sdk'
uses: docker/build-push-action@v6
with:
context: .
file: ./${{ matrix.package }}/Dockerfile
push: true
tags: |
${{ env.DOCKER_REGISTRY }}/${{ matrix.package }}:${{ env.PACKAGE_VERSION }}
${{ env.DOCKER_REGISTRY}}/${{ matrix.package }}:latest
100 changes: 54 additions & 46 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,56 @@
---
name: Task - Lint, Format & Typecheck

on:
workflow_dispatch:
workflow_call:

env:
PYTHON_VERSION: 3.12.4
name: Task - Lint, Format & Typecheck

jobs:
lint-format-typecheck:
continue-on-error: true
runs-on: ubuntu-latest
strategy:
matrix:
package: [pragma-utils, pragma-sdk, price-pusher, vrf-listener, checkpointer, merkle-maker]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: CfirTsabari/actions-pipx@v1
- name: Install poetry
run: pipx install poetry
- name: Set up Python 3.12.4
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- name: Install dependencies
run: |
cd ${{ matrix.package }}
poetry install
- name: Check poetry.lock
run: |
cd ${{ matrix.package }}
poetry lock --check
- name: Run lint
run: |
cd ${{ matrix.package }}
poetry run poe lint
- name: Run format
run: |
cd ${{ matrix.package }}
poetry run poe format_check
- name: Run typecheck
run: |
cd ${{ matrix.package }}
poetry run poe typecheck
on:
workflow_dispatch:
workflow_call:

env:
PYTHON_VERSION: 3.12.4

jobs:
lint-format-typecheck:
continue-on-error: true
runs-on: ubuntu-latest
strategy:
matrix:
package:
[
pragma-utils,
pragma-sdk,
price-pusher,
vrf-listener,
checkpointer,
merkle-maker,
]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: CfirTsabari/actions-pipx@v1
- name: Install poetry
run: pipx install poetry
- name: Set up Python 3.12.4
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- name: Install dependencies
run: |
cd ${{ matrix.package }}
poetry install
- name: Check poetry.lock
run: |
cd ${{ matrix.package }}
poetry lock --check
- name: Run lint
run: |
cd ${{ matrix.package }}
poetry run poe lint
- name: Run format
run: |
cd ${{ matrix.package }}
poetry run poe format_check
- name: Run typecheck
run: |
cd ${{ matrix.package }}
poetry run poe typecheck
60 changes: 30 additions & 30 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
---
name: Task - Publish Package to Test PyPi

on:
push:
branches:
- master
name: Task - Publish Package to Test PyPi

env:
PYTHON_VERSION: 3.12.4

defaults:
run:
working-directory: pragma-sdk
on:
push:
branches:
- master

jobs:
test_pypi_publish:
name: Upload package to Test PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: CfirTsabari/actions-pipx@v1
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- run: pipx inject poetry poetry-monorepo-dependency-plugin
- run: poetry config repositories.test-pypi https://test.pypi.org/legacy/
- run: poetry config pypi-token.test-pypi ${{ secrets.TEST_PYPI_API_TOKEN }}
- run: poetry build -f sdist
- run: poetry publish -r test-pypi --skip-existing
env:
PYTHON_VERSION: 3.12.4

defaults:
run:
working-directory: pragma-sdk

jobs:
test_pypi_publish:
name: Upload package to Test PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: CfirTsabari/actions-pipx@v1
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- run: pipx inject poetry poetry-monorepo-dependency-plugin
- run: poetry config repositories.test-pypi https://test.pypi.org/legacy/
- run: poetry config pypi-token.test-pypi ${{ secrets.TEST_PYPI_API_TOKEN }}
- run: poetry build -f sdist
- run: poetry publish -r test-pypi --skip-existing
Loading

0 comments on commit e333fd6

Please sign in to comment.