forked from kkrt-labs/kakarot-rpc
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (75 loc) · 2.5 KB
/
e2e-pipeline.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
---
name: e2e pipeline
on:
workflow_dispatch:
inputs:
environment:
description: Environment to use
required: true
type: choice
options:
- sepolia
- staging
action:
description: Action to perform on the selected environment
required: true
type: choice
options:
- deploy
- test
jobs:
stage:
runs-on: ubuntu-latest
permissions: write-all
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}
- name: install foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
# Install UV
- uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: lib/kakarot/uv.lock
- uses: actions/setup-python@v5
with:
python-version-file: lib/kakarot/.python-version
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: 0.7.0
- name: Run staging script
env:
KAKAROT_STAGING_PRIVATE_KEY:
${{ secrets.KAKAROT_STAGING_PRIVATE_KEY }}
run: |
cd scripts
sh e2e_pipeline.sh ${{ github.event.inputs.action }} --${{ github.event.inputs.environment }}
- name: Check diff in deployments
run: |
cd lib/kakarot
set +e
git diff --no-patch --exit-code -- deployments/
has_diff=$?
set -e
echo "has_diff=$has_diff" >> $GITHUB_ENV
- name: Create PR for deployment updates
if: ${{ env.has_diff == 1 }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set +e
cd lib/kakarot
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git checkout -b update-staging-deployment-run-${{ github.run_id }}
git add deployments/kakarot-staging/
git commit -m "Update staging deployments from run ${{ github.run_id }}"
git push --set-upstream origin update-staging-deployment-run-${{ github.run_id }} --force
gh pr create --repo=kkrt-labs/kakarot --base=main --head=update-staging-deployment-run-${{ github.run_id }} \
--title "Update staging deployments from staging run ${{ github.run_id }}" \
--body "This PR updates the staging deployments for staging run ${{ github.run_id }}."