Skip to content

Commit

Permalink
Merge pull request #25 from aserto-dev/split_packages
Browse files Browse the repository at this point in the history
Split python packages
  • Loading branch information
oanatmaria authored Jan 17, 2024
2 parents ee7c9f2 + fe3ff72 commit 3a11cf6
Show file tree
Hide file tree
Showing 71 changed files with 1,107 additions and 3,083 deletions.
101 changes: 82 additions & 19 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ env:


jobs:
tests:
name: Run tests
test:
name: Run test
runs-on: ubuntu-latest
steps:
- name: Read Configuration
Expand Down Expand Up @@ -57,26 +57,89 @@ jobs:
with:
version: 1.2.1

- name: Lint & test aserto package
- name: Run lint
run: |
cd packages/aserto
poetry install
poetry run pyright .
- name: Run tests
run: |
poetry run pytest -vv
cd ../..
release:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')

- name: Lint & test aserto-idp package
run : |
cd packages/aserto-idp
poetry install
poetry run pyright .
poetry run pytest -vv
cd ../..
name: Release to pypi
steps:
- name: Read Configuration
uses: hashicorp/[email protected]
id: vault
with:
url: ${{ env.VAULT_ADDR }}
token: ${{ secrets.VAULT_TOKEN }}
secrets: |
kv/data/github "SSH_PRIVATE_KEY" | SSH_PRIVATE_KEY;
kv/data/pypi "API_TOKEN" | POETRY_HTTP_BASIC_PYPI_PASSWORD;
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}

- name: Setup caching
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
.ext
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum', 'Depfile') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: |
mkdir -p $HOME/.ssh
umask 0077 && echo -e "${SSH_PRIVATE_KEY}" > $HOME/.ssh/id_rsa
ssh-keyscan github.com >> $HOME/.ssh/known_hosts
git config --global url."[email protected]:".insteadOf https://github.com/
git config --global user.email "[email protected]"
git config --global user.name "Aserto Bot"
eval `ssh-agent`
ssh-add $HOME/.ssh/id_rsa
go run mage.go deps
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Build and push the python package
env:
# When using a PYPI API token, the user name must be set to "__token__"
POETRY_HTTP_BASIC_PYPI_USERNAME: __token__
run: go run mage.go release

- name: Bump to the next version
run: go run mage.go bump patch

- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: 'Bump to next version'
add: 'pyproject.toml'
push: origin HEAD:main

- name: Lint & test flask-aserto package
run : |
cd packages/flask-aserto
poetry install
poetry run pyright .
poetry run pytest -vv
cd ../..
13 changes: 13 additions & 0 deletions .github/workflows/gitleaks-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: gitleaks-check

on: [pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: gitleaks-check
uses: aserto-dev/gitleaks-action@master
55 changes: 0 additions & 55 deletions DEVELOPER.md

This file was deleted.

5 changes: 5 additions & 0 deletions Depfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
go:
sver:
importPath: "github.com/aserto-dev/sver/cmd/sver"
version: "v1.3.13"
Loading

0 comments on commit 3a11cf6

Please sign in to comment.