-
Notifications
You must be signed in to change notification settings - Fork 14
127 lines (122 loc) · 3.82 KB
/
Test.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Build & Test
on:
push:
branches: "*"
pull_request:
branches: "*"
jobs:
build:
runs-on: ubuntu-latest-m
env:
REGISTRY: ghcr.io/fhenixprotocol/nitro
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_PAT }}
- uses: actions/setup-go@v4
with:
go-version: 1.20.11
- name: Docker Login
uses: docker/login-action@v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GH_PAT }}
- name: "Install Pnpm"
uses: "pnpm/action-setup@v2"
with:
version: "8"
# - name: Build fhe-engine
# run: |
# cd warp-drive/fhe-engine && RUSTFLAGS="-C target-cpu=native" cargo build --release
- name: Install Dependencies
run: |
make install
- name: Make gen
run: |
make gen
- name: Compile
run: |
cp solidity/.env.example solidity/.env
make compile
- name: Lint
run: |
make lint
- name: Build Local Dev Image
uses: docker/build-push-action@v4
with:
file: Dockerfile
context: .
tags: ghcr.io/fhenixprotocol/localfhenix:v0.0.0
- name: Run Local Dev Image
run: |
docker run -p 8547:8547 -p 8548:8548 -p 3000:3000 -e FHEOS_SECURITY_ZONES=2 ghcr.io/fhenixprotocol/localfhenix:v0.0.0 &
- name: Run tests
run: |
make test
- name: Package Contracts
run: |
tar -cvf contracts.tar solidity/FHE.sol solidity/FheOS.sol
- uses: actions/upload-artifact@v3
name: Store contracts
with:
name: contracts.tar
path: contracts.tar
push-to-contracts-repo:
needs: [build]
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v4
name: Checkout Fhenix-Contracts
with:
repository: FhenixProtocol/fhenix-contracts
ref: 'main'
token: ${{ secrets.GH_PAT }}
- name: Parse GH Commit Hash
shell: bash
run: |
echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
- uses: actions/download-artifact@v3
with:
name: contracts.tar
path: .
- name: setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "noreply@github.com"
- name: Copy test contracts & Generated libs
run: |
ls -l
mkdir -p test/automated/contracts
mkdir temp_extraction
tar -xvf contracts.tar -C temp_extraction
rm contracts.tar
mv temp_extraction/solidity/FHE.sol temp_extraction/solidity/FheOS.sol contracts/
- name: Commit Changes
continue-on-error: true
run: |
git add contracts/FHE.sol
git add contracts/FheOS.sol
git commit -m "FheOS updated - pushing new contracts and scripts"
- name: Create Pull Request
id: cpr
continue-on-error: true
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GH_PAT }}
commit-message: Updated Contracts from FheOS
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: fheos-${{ env.sha_short }}
delete-branch: true
title: 'Update Contracts from FheOS'
body: |
Updated contracts from FheOS push to [master](https://github.com/fhenixprotocol/fheos/commit/${{ github.sha }})
labels: |
report
automated pr
draft: false