-
Notifications
You must be signed in to change notification settings - Fork 4
88 lines (76 loc) · 2.45 KB
/
fixtures.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
name: Generate and Merge Fixtures
on:
workflow_dispatch:
push:
branches:
- dev
jobs:
generate_fixtures:
runs-on: ubuntu-latest
steps:
- name: Checkout current repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Install CLI binary
run: |
cargo install --locked -f --path cli/
- name: Clone hdp-test repository
uses: actions/checkout@v4
with:
repository: HerodotusDev/hdp-test
token: ${{ secrets.REPO_ACCESS_TOKEN }}
path: hdp-test
- name: Generate .env file
run: |
cd hdp-test
cat << EOF > .env
RPC_URL_ETHEREUM_SEPOLIA=${{ secrets.RPC_URL_ETHEREUM_SEPOLIA }}
RPC_CHUNK_SIZE_ETHEREUM_SEPOLIA=${{ secrets.RPC_CHUNK_SIZE_ETHEREUM_SEPOLIA }}
DRY_RUN_CAIRO_PATH=${{ secrets.DRY_RUN_CAIRO_PATH }}
SOUND_RUN_CAIRO_PATH=${{ secrets.SOUND_RUN_CAIRO_PATH }}
SAVE_FETCH_KEYS_FILE=${{ secrets.SAVE_FETCH_KEYS_FILE }}
EOF
- name: Set up and generate fixtures
run: |
cd hdp-test
make cleanup
make setup
source venv/bin/activate
make generate
- name: Commit and push new fixtures
run: |
cd hdp-test
git config user.name github-actions
git config user.email github-actions@github.com
git fetch origin
git checkout ${{ github.ref_name }}
git pull origin ${{ github.ref_name }}
git add .
git commit -m "Update fixtures"
git push origin ${{ github.ref_name }}
merge_to_main:
needs: generate_fixtures
if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
steps:
- name: Checkout hdp-test repository
uses: actions/checkout@v4
with:
repository: HerodotusDev/hdp-test
token: ${{ secrets.REPO_ACCESS_TOKEN }}
- name: Merge fixtures to main
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git fetch origin
git checkout main
git merge origin/${{ github.ref_name }}
git push origin main