-
Notifications
You must be signed in to change notification settings - Fork 2
98 lines (78 loc) · 3.09 KB
/
publish-pypi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: publish-pypi
on:
release:
types: [published]
# Uncomment the following line to enable manual publishing
# workflow_dispatch:
jobs:
Regression:
env:
ETHSCAN_API_KEY: ${{ secrets.ETHSCAN_API_KEY }}
QUORUM_PATH: "Quorum/tests"
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
runs-on: ubuntu-latest
container:
image: public.ecr.aws/certora/cvt-image:2024.10.23-4499-c4f8ad4
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Poetry
run: pip3 install poetry==1.8.5
- name: Install Quorum Repo
run: poetry install
- name: Lint with Ruff
run: |
poetry run ruff check src
poetry run ruff format --check src
- name: Run unit tests
run: poetry run pytest src/quorum/tests --maxfail=1 --disable-warnings --tb=short
- name: Run Quorum setup
run: poetry run quorum setup --working-dir workdir
- name: Init working directory
run: |
mv src/quorum/tests/regression.json workdir/regression.json
mv src/quorum/tests/ground_truth.json workdir/ground_truth.json
echo "ETHSCAN_API_KEY=${ETHSCAN_API_KEY}" >> workdir/.env
echo "ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}" >> workdir/.env
- name: Single Address Test
working-directory: workdir
run: poetry run quorum validate-address --protocol-name Aave --chain Ethereum --payload-address 0xAD6c03BF78A3Ee799b86De5aCE32Bb116eD24637
- name: Batch Test
working-directory: workdir
run: poetry run quorum validate-batch --config regression.json
- name: Proposal ID Test
working-directory: workdir
run: poetry run quorum validate-by-id --proposal-id 137 --protocol-name Aave
- name: IPFS Test
working-directory: workdir
run: poetry run quorum validate-ipfs --proposal-id 20 --chain Scroll --payload-address 0x2B25cb729D90630395Cd3140f3460a73A41Fe5f0
- name: Generate Report
working-directory: workdir
run: poetry run quorum generate-report --proposal_id 137
publish:
needs: Regression
runs-on: ubuntu-latest
permissions:
contents: write
env:
POETRY_DYNAMIC_VERSIONING_BYPASS: ${{ github.ref_name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10' # Specify the Python version compatible with your project
- name: Install Poetry Locally
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "${HOME}/.local/bin" >> $GITHUB_PATH
- name: Install Automatic Versioning Plugin
run: poetry self add "poetry-dynamic-versioning[plugin]"
- name: Configure PyPI Repository
run: poetry config pypi-token.pypi ${{ secrets.PYPI_PASSWORD }}
- name: "Publish to PyPI with version: ${{ env.POETRY_DYNAMIC_VERSIONING_BYPASS }}"
run: poetry publish --build