Skip to content

Commit f69270a

Browse files
feat: Local signing for stellar (#178)
* feat: Local signing for stellar Signed-off-by: dylankilkenny <[email protected]> * chore: Upgrade soroban-rs Signed-off-by: dylankilkenny <[email protected]> * chore: Update lock Signed-off-by: dylankilkenny <[email protected]> * refactor: Review changes Signed-off-by: dylankilkenny <[email protected]> * chore: Update lock Signed-off-by: dylankilkenny <[email protected]> * fix: Test clean up of unneeded files * fix: Lock file * chore: Fix docker rmi * chore: Add docker image description * chore: Adjust quotes in description * chore: Tests Signed-off-by: dylankilkenny <[email protected]> * chore: Lock file Signed-off-by: dylankilkenny <[email protected]> --------- Signed-off-by: dylankilkenny <[email protected]> Co-authored-by: tirumerla <[email protected]>
1 parent 9112b7c commit f69270a

File tree

22 files changed

+1593
-272
lines changed

22 files changed

+1593
-272
lines changed

.github/workflows/ci.yaml

Lines changed: 43 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,35 @@
11
---
22
name: CI
3-
43
on:
54
pull_request:
65
branches:
76
- main
8-
types: [opened, synchronize, reopened, ready_for_review]
7+
types:
8+
- opened
9+
- synchronize
10+
- reopened
11+
- ready_for_review
912
push:
1013
branches:
1114
- main
12-
1315
# run concurrency group for the workflow
1416
concurrency:
1517
group: ${{ github.workflow }}-${{ github.ref }}
1618
cancel-in-progress: true
17-
1819
jobs:
1920
changed_files:
2021
if: ${{ github.event.pull_request.draft == false }}
2122
runs-on: ubuntu-latest
2223
name: Test changed-files
2324
outputs:
2425
changed-rust-files: ${{ steps.changed-files-yaml.outputs.code_any_changed }}
25-
changed-lockfile-files: ${{ steps.changed-files-yaml.outputs.lockfile_any_changed
26-
}}
27-
changed-docker-files: ${{ steps.changed-files-yaml.outputs.docker_any_changed
28-
}}
29-
changed-tests-files: ${{ steps.changed-files-yaml.outputs.tests_any_changed
30-
}}
26+
changed-lockfile-files: ${{ steps.changed-files-yaml.outputs.lockfile_any_changed }}
27+
changed-docker-files: ${{ steps.changed-files-yaml.outputs.docker_any_changed }}
28+
changed-tests-files: ${{ steps.changed-files-yaml.outputs.tests_any_changed }}
3129
steps:
3230
# Checkout the repository
3331
- name: Checkout Code
3432
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
35-
3633
- name: Get changed files
3734
id: changed-files-yaml
3835
uses: tj-actions/changed-files@b74df86ccb65173a8e33ba5492ac1a2ca6b216fd # v46.0.4
@@ -52,55 +49,50 @@ jobs:
5249
tests:
5350
- '**/*.rs'
5451
- tests/**/*.json
55-
5652
ci:
5753
if: ${{ github.event.pull_request.draft == false && always() }}
5854
permissions:
5955
contents: none
6056
name: CI
61-
needs: [msrv, lockfile, rustfmt, clippy]
57+
needs:
58+
- msrv
59+
- lockfile
60+
- rustfmt
61+
- clippy
6262
runs-on: ubuntu-latest
6363
steps:
6464
- name: Failed
6565
run: exit 1
6666
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
67-
6867
msrv:
69-
if: ${{ github.event.pull_request.draft == false && github.event_name != 'push'
70-
&& (needs.changed_files.outputs.changed-rust-files == 'true' || needs.changed_files.outputs.changed-lockfile-files
71-
== 'true') }}
68+
if: ${{ github.event.pull_request.draft == false && github.event_name != 'push' && (needs.changed_files.outputs.changed-rust-files == 'true' || needs.changed_files.outputs.changed-lockfile-files == 'true') }}
7269
runs-on: ubuntu-latest
7370
needs: changed_files
7471
steps:
7572
# Checkout the repository
7673
- name: Checkout Code
7774
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
78-
7975
- name: Prepare
8076
id: init
8177
uses: ./.github/actions/prepare
8278

8379
# Get the output of the prepare composite action
8480
- name: Get cache-hit output
8581
run: 'echo "Cache hit >>>>>: ${{ steps.init.outputs.cache-hit }}"'
86-
8782
- name: Install cargo hack
8883
uses: taiki-e/install-action@cargo-hack
8984

9085
# Check the minimum supported Rust version
9186
- name: Default features
9287
run: cargo hack check --feature-powerset --locked --rust-version --all-targets
93-
9488
lockfile:
95-
if: ${{ github.event.pull_request.draft == false && github.event_name != 'push'
96-
&& needs.changed_files.outputs.changed-lockfile-files == 'true' }}
89+
if: ${{ github.event.pull_request.draft == false && github.event_name != 'push' && needs.changed_files.outputs.changed-lockfile-files == 'true' }}
9790
needs: changed_files
9891
runs-on: ubuntu-latest
9992
steps:
10093
# Checkout the repository
10194
- name: Checkout Code
10295
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
103-
10496
- name: Prepare
10597
id: init
10698
uses: ./.github/actions/prepare
@@ -112,17 +104,14 @@ jobs:
112104
# Check the lockfile
113105
- name: Validate lockfile updates
114106
run: cargo update --locked
115-
116107
rustfmt:
117-
if: ${{ github.event.pull_request.draft == false && github.event_name != 'push'
118-
&& needs.changed_files.outputs.changed-rust-files == 'true' }}
108+
if: ${{ github.event.pull_request.draft == false && github.event_name != 'push' && needs.changed_files.outputs.changed-rust-files == 'true' }}
119109
needs: changed_files
120110
runs-on: ubuntu-latest
121111
steps:
122112
# Checkout the repository
123113
- name: Checkout Code
124114
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
125-
126115
- name: Prepare
127116
id: init
128117
uses: ./.github/actions/prepare
@@ -134,87 +123,89 @@ jobs:
134123
# Check the formatting of the code
135124
- name: Check formatting
136125
run: cargo fmt --all -- --check
137-
138126
clippy:
139-
if: ${{ github.event.pull_request.draft == false && github.event_name != 'push'
140-
&& needs.changed_files.outputs.changed-rust-files == 'true' }}
127+
if: ${{ github.event.pull_request.draft == false && github.event_name != 'push' && needs.changed_files.outputs.changed-rust-files == 'true' }}
141128
needs: changed_files
142129
runs-on: ubuntu-latest
143130
steps:
144131
# Checkout the repository
145132
- name: Checkout Code
146133
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
147-
148134
- name: Prepare
149135
id: init
150136
uses: ./.github/actions/prepare
151137

152138
# Get the output of the prepare composite action
153139
- name: Get cache-hit output
154140
run: 'echo "Cache hit >>>>>: ${{ steps.init.outputs.cache-hit }}"'
155-
156141
- name: Install SARIF tools
157142
run: cargo install clippy-sarif --locked
158-
159143
- name: Install SARIF tools
160144
run: cargo install sarif-fmt --locked
161-
162145
- name: Check
163146
run: >
164147
cargo clippy --all-features --all-targets --message-format=json
165148
| clippy-sarif
166149
| tee clippy-results.sarif
167150
| sarif-fmt
168151
continue-on-error: true
169-
170152
- name: upload sarif artifact
171153
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
172154
with:
173155
name: clippy-results.sarif
174156
path: clippy-results.sarif
175157
retention-days: 1
176-
177158
- name: Upload
178159
uses: github/codeql-action/upload-sarif@dd196fa9ce80b6bacc74ca1c32bd5b0ba22efca7 # v3.28.3
179160
with:
180161
sarif_file: clippy-results.sarif
181162
wait-for-processing: true
182-
183163
- name: Report status
184164
run: cargo clippy --all-features --all-targets -- -D warnings --allow deprecated
185165
test:
186-
if: ${{ github.event.pull_request.draft == false && needs.changed_files.outputs.changed-tests-files
187-
== 'true' }}
166+
if: ${{ github.event.pull_request.draft == false && needs.changed_files.outputs.changed-tests-files == 'true' }}
188167
permissions:
189168
contents: read
190-
needs: changed_files
169+
needs:
170+
- changed_files
171+
- ci
191172
runs-on: ubuntu-latest
192173
steps:
193174
# Checkout the repository
194175
- name: Checkout Code
195176
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
196-
177+
- name: Get disk space
178+
run: df -h
179+
continue-on-error: true
180+
- name: free disk space
181+
run: |
182+
sudo swapoff -a
183+
sudo rm -f /swapfile
184+
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
185+
sudo apt clean
186+
if [[ $(docker image ls -aq) ]]; then
187+
docker rmi $(docker image ls -aq)
188+
else
189+
echo "No Docker images found to remove"
190+
fi
191+
df -h
197192
- name: Prepare
198193
id: init
199194
uses: ./.github/actions/prepare
200195

201196
# Get the output of the prepare composite action
202197
- name: Get cache-hit output
203198
run: 'echo "Cache hit >>>>>: ${{ steps.init.outputs.cache-hit }}"'
204-
205199
- name: Setup Rust
206200
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1.11.0
207201
with:
208202
toolchain: stable
209203
components: llvm-tools-preview
210204
rustflags: ''
211-
212205
- name: Install cargo hack
213206
uses: taiki-e/install-action@cargo-hack
214-
215207
- name: Install cargo-llvm-cov
216208
uses: taiki-e/install-action@cargo-llvm-cov
217-
218209
- name: Build
219210
run: cargo test --no-run --locked
220211

@@ -224,26 +215,23 @@ jobs:
224215
LLVM_PROFILE_FILE: unit-%p-%m.profraw
225216
RUSTFLAGS: -Cinstrument-coverage
226217
RUST_TEST_THREADS: 1
227-
run: cargo hack llvm-cov --locked --lib --ignore-filename-regex ".*/relayer_docs\.rs$"
228-
--lcov --output-path unit-lcov.info
218+
run: cargo hack llvm-cov --locked --lib --ignore-filename-regex ".*/relayer_docs\.rs$" --lcov --output-path unit-lcov.info
229219

230220
# Integration tests coverage
231221
- name: Run Integration Tests and Generate Coverage Report
232222
env:
233223
LLVM_PROFILE_FILE: integration-%p-%m.profraw
234224
RUSTFLAGS: -Cinstrument-coverage
235225
RUST_TEST_THREADS: 1
236-
run: cargo hack llvm-cov --locked --ignore-filename-regex ".*/relayer_docs\.rs$"
237-
--lcov --output-path integration-lcov.info --test integration
226+
run: cargo hack llvm-cov --locked --ignore-filename-regex ".*/relayer_docs\.rs$" --lcov --output-path integration-lcov.info --test integration
238227

239228
# Properties tests coverage
240229
- name: Run Properties Tests
241230
env:
242231
LLVM_PROFILE_FILE: properties-%p-%m.profraw
243232
RUSTFLAGS: -Cinstrument-coverage
244233
RUST_TEST_THREADS: 1
245-
run: cargo hack llvm-cov --locked --ignore-filename-regex ".*/relayer_docs\.rs$"
246-
--lcov --output-path properties-lcov.info --test properties
234+
run: cargo hack llvm-cov --locked --ignore-filename-regex ".*/relayer_docs\.rs$" --lcov --output-path properties-lcov.info --test properties
247235

248236
# Upload unit coverage
249237
- name: Upload Unit Coverage to Codecov
@@ -274,19 +262,19 @@ jobs:
274262
files: properties-lcov.info
275263
flags: properties
276264
fail_ci_if_error: true
277-
278265
docker-scan:
279266
runs-on: ubuntu-latest
280-
needs: [changed_files, ci]
267+
needs:
268+
- changed_files
269+
- ci
270+
- test
281271
if: ${{ needs.changed_files.outputs.changed-docker-files == 'true' }}
282272
steps:
283273
# Checkout the repository
284274
- name: Checkout Code
285275
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
286-
287276
- name: Set up Docker Buildx
288277
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
289-
290278
- name: Build local container
291279
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
292280
with:
@@ -295,7 +283,6 @@ jobs:
295283
load: true
296284
file: Dockerfile.development
297285
platforms: linux/amd64
298-
299286
- name: Scan image
300287
uses: anchore/scan-action@7c05671ae9be166aeb155bad2d7df9121823df32 # v6.1.0
301288
with:

.github/workflows/release-docker.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
---
22
name: Build and push Docker image
3-
43
on:
54
workflow_call:
65
inputs:
76
tag:
87
type: string
98
description: The tag to use for the Docker image.
109
required: true
11-
1210
jobs:
1311
build-push-image:
1412
name: Build and Push Docker Image
@@ -24,22 +22,18 @@ jobs:
2422
status: starting
2523
steps: ${{ toJson(steps) }}
2624
channel: ${{ env.SLACK_CHANNEL }}
27-
message: Starting docker build and push to dockerhub for ${{ github.repository
28-
}} with tag ${{ inputs.tag }}......
25+
message: Starting docker build and push to dockerhub for ${{ github.repository }} with tag ${{ inputs.tag }}......
2926
if: always()
30-
3127
- name: Get github app token
3228
uses: actions/create-github-app-token@3ff1caaa28b64c9cc276ce0a02e2ff584f3900c5 # v2.0.2
3329
id: gh-app-token
3430
with:
3531
app-id: ${{ vars.GH_APP_ID }}
3632
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
37-
3833
- name: Checkout release branch
3934
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4035
with:
4136
ref: ${{ inputs.tag }}
42-
4337
- name: Docker meta
4438
id: meta
4539
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
@@ -56,18 +50,16 @@ jobs:
5650
org.opencontainers.image.created={{commit_date 'YYYY-MM-DDTHH:mm:ss.SSS[Z]'}}
5751
org.opencontainers.image.title=openzeppelin-relayer
5852
org.opencontainers.image.vendor=openzeppelin
53+
org.opencontainers.image.description="OpenZeppelin Relayer service provides infrastructure to relay transactions to the EVM & Non-EVM networks."
5954
env:
6055
DOCKER_METADATA_SHORT_SHA_LENGTH: 10
61-
6256
- name: Login to Dockerhub
6357
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
6458
with:
6559
username: ${{ vars.DOCKERHUB_USERNAME }}
6660
password: ${{ secrets.DOCKERHUB_PAT }}
67-
6861
- name: Set Up Docker Buildx
6962
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
70-
7163
- name: Build Docker image
7264
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
7365
id: build
@@ -82,7 +74,6 @@ jobs:
8274
sbom: true
8375
tags: ${{ steps.meta.outputs.tags }}
8476
labels: ${{ steps.meta.outputs.labels }}
85-
8677
- name: Attest
8778
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
8879
id: attest
@@ -91,7 +82,6 @@ jobs:
9182
subject-digest: ${{ steps.build.outputs.digest }}
9283
push-to-registry: false
9384
github-token: ${{ steps.gh-app-token.outputs.token }}
94-
9585
- name: Slack notification success or failure
9686
uses: act10ns/slack@44541246747a30eb3102d87f7a4cc5471b0ffb7d # v2.1.0
9787
with:
@@ -100,7 +90,6 @@ jobs:
10090
channel: ${{ env.SLACK_CHANNEL }}
10191
message: Push to Dockerhub ${{ job.status }}!
10292
if: always()
103-
10493
- name: Print image digest to summary
10594
run: |-
10695
echo "Image tags: ${{ steps.meta.outputs.tags }}" >> "${GITHUB_STEP_SUMMARY}"

0 commit comments

Comments
 (0)