Skip to content

Commit 46f9741

Browse files
authored
fix: verified svm builds (#997)
* fix: verified svm builds Signed-off-by: Reinis Martinsons <[email protected]> * fix: libudev-dev Signed-off-by: Reinis Martinsons <[email protected]> * fix: libudev Signed-off-by: Reinis Martinsons <[email protected]> * fix: libusb Signed-off-by: Reinis Martinsons <[email protected]> * fix: build dependencies Signed-off-by: Reinis Martinsons <[email protected]> * fix: build dependencies Signed-off-by: Reinis Martinsons <[email protected]> * fix: ignore-optional Signed-off-by: Reinis Martinsons <[email protected]> * fix: trigger ci Signed-off-by: Reinis Martinsons <[email protected]> * fix: trigger ci Signed-off-by: Reinis Martinsons <[email protected]> * fix: remove common tests Signed-off-by: Reinis Martinsons <[email protected]> * fix: remove only Signed-off-by: Reinis Martinsons <[email protected]> * fix: remove build-svm-verified Signed-off-by: Reinis Martinsons <[email protected]> * fix: build-verified script Signed-off-by: Reinis Martinsons <[email protected]> * fix: test-verified script Signed-off-by: Reinis Martinsons <[email protected]> * fix: rename scripts Signed-off-by: Reinis Martinsons <[email protected]> * fix: trigger ci Signed-off-by: Reinis Martinsons <[email protected]> * fix: use yaml anchor for matrix Signed-off-by: Reinis Martinsons <[email protected]> * fix: remove yaml anchor for matrix Signed-off-by: Reinis Martinsons <[email protected]> * fix: drop matrix Signed-off-by: Reinis Martinsons <[email protected]> * fix: pre-release Signed-off-by: Reinis Martinsons <[email protected]> * fix: use tarball for artifact caching Signed-off-by: Reinis Martinsons <[email protected]> * fix: reset version Signed-off-by: Reinis Martinsons <[email protected]> * fix: trigger ci Signed-off-by: Reinis Martinsons <[email protected]> * fix: typo in referenced step name Signed-off-by: Reinis Martinsons <[email protected]> --------- Signed-off-by: Reinis Martinsons <[email protected]>
1 parent 7362cd0 commit 46f9741

File tree

16 files changed

+379
-80
lines changed

16 files changed

+379
-80
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Reusable action to cache EVM artifacts if the source code, compiler settings and dependencies have not changed.
2+
name: Cache EVM Artifacts
3+
inputs:
4+
node_version:
5+
description: "Node version used to generate the artifacts"
6+
required: true
7+
outputs:
8+
cache-hit:
9+
description: "Whether the cache was hit"
10+
value: ${{ steps.evm-artifacts-cache.outputs.cache-hit }}
11+
runs:
12+
using: "composite"
13+
steps:
14+
- name: Restore cached EVM artifacts
15+
id: evm-artifacts-cache
16+
uses: actions/cache@v4
17+
with:
18+
# The job that generates the artifacts is responsible for archiving them to the cache tarball. This avoids any
19+
# conflicts with other caching actions that might have cleaned some of cached contents.
20+
path: evm-artifacts.tar
21+
key: evm-artifacts-${{ runner.os }}-node-${{ inputs.node_version }}-${{ hashFiles('yarn.lock', 'hardhat.config.ts', 'contracts/**/*.sol') }}
22+
- name: Unpack restored EVM artifacts
23+
if: steps.evm-artifacts-cache.outputs.cache-hit == 'true'
24+
shell: bash
25+
run: tar -xf evm-artifacts.tar
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Reusable action to cache SVM artifacts if the source code and dependencies have not changed.
2+
name: Cache SVM Artifacts
3+
inputs:
4+
type:
5+
description: "Type of the artifacts, used in cache key and archive name"
6+
required: true
7+
node_version:
8+
description: "Node version used to generate the artifacts"
9+
required: true
10+
outputs:
11+
cache-hit:
12+
description: "Whether the cache was hit"
13+
value: ${{ steps.svm-artifacts-cache.outputs.cache-hit }}
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Restore cached SVM artifacts
18+
id: svm-artifacts-cache
19+
uses: actions/cache@v4
20+
with:
21+
# The job that generates the artifacts is responsible for archiving them to the cache tarball. This avoids any
22+
# conflicts with other caching actions that might have cleaned some of cached contents.
23+
path: svm-${{ inputs.type }}.tar
24+
key: svm-${{ inputs.type }}-${{ runner.os }}-node-${{ inputs.node_version }}-${{ hashFiles('Cargo.lock', 'programs/**/Cargo.toml', 'programs/**/Xargo.toml', 'programs/**/*.rs') }}
25+
- name: Unpack restored SVM artifacts
26+
if: steps.svm-artifacts-cache.outputs.cache-hit == 'true'
27+
shell: bash
28+
run: tar -xf svm-${{ inputs.type }}.tar
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Generate EVM artifacts
2+
inputs:
3+
path:
4+
description: "Paths to archive for caching"
5+
required: true
6+
node_version:
7+
description: "Node version to use"
8+
required: true
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: "Use Node ${{ inputs.node_version }}"
13+
uses: actions/setup-node@v3
14+
with:
15+
node-version: "${{ inputs.node_version }}"
16+
cache: yarn
17+
- name: Install packages
18+
shell: bash
19+
run: yarn install --frozen-lockfile
20+
- name: Build EVM
21+
shell: bash
22+
run: yarn build-evm
23+
- name: Archive EVM artifacts (for caching)
24+
shell: bash
25+
env:
26+
CACHE_PATHS: ${{ inputs.path }}
27+
run: echo "$CACHE_PATHS" | xargs tar -cf evm-artifacts.tar
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Generate SVM IDL artifacts
2+
inputs:
3+
type:
4+
description: "Type of the artifacts, used in archive name"
5+
required: true
6+
path:
7+
description: "Paths to archive for caching"
8+
required: true
9+
node_version:
10+
description: "Node version to use"
11+
required: true
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: "Use Node ${{ inputs.node_version }}"
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: "${{ inputs.node_version }}"
19+
cache: yarn
20+
- name: Setup Anchor & Solana
21+
uses: ./.github/actions/setup-solana-anchor
22+
with:
23+
node_version: ${{ inputs.node_version }}
24+
- name: Cache Cargo dependencies
25+
uses: Swatinem/rust-cache@v2
26+
- name: Install packages
27+
shell: bash
28+
run: yarn install --frozen-lockfile --ignore-optional
29+
- name: Generate SVM IDL artifacts
30+
shell: bash
31+
run: yarn generate-svm-artifacts
32+
- name: Archive SVM IDL artifacts (for caching)
33+
shell: bash
34+
env:
35+
CACHE_PATHS: ${{ inputs.path }}
36+
run: echo "$CACHE_PATHS" | xargs tar -cf svm-${{ inputs.type }}.tar
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Setup Solana and Anchor
2+
inputs:
3+
verify_version:
4+
description: "Solana verify version to install (leave empty to skip)"
5+
required: false
6+
default: ""
7+
node_version:
8+
description: "Node version to install"
9+
required: true
10+
runs:
11+
using: "composite"
12+
steps:
13+
- name: Extract Solana versions
14+
uses: solana-developers/github-actions/[email protected]
15+
id: versions
16+
- name: Setup Anchor & Solana
17+
uses: solana-developers/github-actions/[email protected]
18+
with:
19+
anchor_version: ${{ steps.versions.outputs.anchor_version }}
20+
solana_version: ${{ steps.versions.outputs.solana_version }}
21+
verify_version: ${{ inputs.verify_version }}
22+
node_version: ${{ inputs.node_version }}

0 commit comments

Comments
 (0)