-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update a couple steps/dependencies in README.
- Loading branch information
1 parent
26d98d9
commit 885c9c3
Showing
5 changed files
with
205 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"leap":{ | ||
"target":"4" | ||
}, | ||
"cdt":{ | ||
"target":"4", | ||
"prerelease":false | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"ubuntu22": { | ||
"dockerfile": ".cicd/platforms/ubuntu22.Dockerfile" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM ubuntu:jammy | ||
ENV TZ="America/New_York" | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get upgrade -y && \ | ||
apt-get install -y build-essential \ | ||
cmake \ | ||
gcc-11 \ | ||
g++-11 \ | ||
git \ | ||
jq \ | ||
wget | ||
|
||
RUN wget https://nodejs.org/dist/v18.17.0/node-v18.17.0-linux-x64.tar.xz | ||
RUN tar xvfJ node-v18.17.0-linux-x64.tar.xz | ||
RUN cp -r node-v18.17.0-linux-x64/{bin,include,lib,share} /usr/ | ||
|
||
RUN npm install -g solc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,182 @@ | ||
name: "Build & Test" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- release/* | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
packages: read | ||
contents: read | ||
inputs: | ||
override-leap-dev: | ||
description: Override leap-dev target | ||
type: string | ||
override-leap-dev-prerelease: | ||
type: choice | ||
description: Override leap-dev prelease | ||
options: | ||
- default | ||
- true | ||
- false | ||
override-leap: | ||
description: Override leap target | ||
type: string | ||
override-leap-prerelease: | ||
type: choice | ||
description: Override leap prelease | ||
options: | ||
- default | ||
- true | ||
- false | ||
override-cdt: | ||
description: 'Override cdt target' | ||
type: string | ||
override-cdt-prerelease: | ||
type: choice | ||
description: Override cdt prelease | ||
options: | ||
- default | ||
- true | ||
- false | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
tmp: | ||
name: Stub | ||
d: | ||
name: Discover Platforms | ||
runs-on: ubuntu-latest | ||
outputs: | ||
missing-platforms: ${{steps.discover.outputs.missing-platforms}} | ||
p: ${{steps.discover.outputs.platforms}} | ||
steps: | ||
- name: Discover Platforms | ||
id: discover | ||
uses: AntelopeIO/discover-platforms-action@v1 | ||
with: | ||
platform-file: .cicd/platforms.json | ||
password: ${{secrets.GITHUB_TOKEN}} | ||
package-name: builders | ||
|
||
build-platforms: | ||
name: Build Platforms | ||
needs: d | ||
if: needs.d.outputs.missing-platforms != '[]' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: ${{fromJSON(needs.d.outputs.missing-platforms)}} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
steps: | ||
- name: Workflow Stub | ||
- name: Login to Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{github.repository_owner}} | ||
password: ${{secrets.GITHUB_TOKEN}} | ||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: true | ||
tags: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}} | ||
file: ${{fromJSON(needs.d.outputs.p)[matrix.platform].dockerfile}} | ||
|
||
versions: | ||
name: Determine Versions | ||
runs-on: ubuntu-latest | ||
outputs: | ||
leap-dev-target: ${{steps.versions.outputs.leap-dev-target}} | ||
leap-dev-prerelease: ${{steps.versions.outputs.leap-dev-prerelease}} | ||
leap-target: ${{steps.versions.outputs.leap-target}} | ||
leap-prerelease: ${{steps.versions.outputs.leap-prerelease}} | ||
cdt-target: ${{steps.versions.outputs.cdt-target}} | ||
cdt-prerelease: ${{steps.versions.outputs.cdt-prerelease}} | ||
steps: | ||
- name: Setup versions from input or defaults | ||
id: versions | ||
env: | ||
GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
run: | | ||
DEFAULTS_JSON=$(curl -sSfL $(gh api https://api.github.com/repos/${{github.repository}}/contents/.cicd/defaults.json?ref=${{github.sha}} --jq .download_url)) | ||
echo leap-target=$(echo "$DEFAULTS_JSON" | jq -r '."leap".target') >> $GITHUB_OUTPUT | ||
echo cdt-target=$(echo "$DEFAULTS_JSON" | jq -r '."cdt".target') >> $GITHUB_OUTPUT | ||
echo cdt-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '."cdt".prerelease') >> $GITHUB_OUTPUT | ||
if [[ "${{inputs.override-leap}}" != "" ]]; then | ||
echo leap-target=${{inputs.override-leap}} >> $GITHUB_OUTPUT | ||
fi | ||
if [[ "${{inputs.override-cdt}}" != "" ]]; then | ||
echo cdt-target=${{inputs.override-cdt}} >> $GITHUB_OUTPUT | ||
fi | ||
if [[ "${{inputs.override-cdt-prerelease}}" == +(true|false) ]]; then | ||
echo cdt-prerelease=${{inputs.override-cdt-prerelease}} >> $GITHUB_OUTPUT | ||
fi | ||
build: | ||
name: EOS EVM Bridge Contracts Build & Test | ||
needs: [d, build-platforms, versions] | ||
if: always() && needs.d.result == 'success' && (needs.build-platforms.result == 'success' || needs.build-platforms.result == 'skipped') && needs.versions.result == 'success' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ ubuntu22 ] | ||
runs-on: ubuntu-latest | ||
container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}} | ||
|
||
steps: | ||
- name: Checkout evm-bridge-contracts | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
submodules: 'recursive' | ||
token: ${{ steps.auth.outputs.token }} | ||
path: evm-bridge-contracts | ||
|
||
- name: Download CDT | ||
uses: AntelopeIO/asset-artifact-download-action@v3 | ||
with: | ||
owner: AntelopeIO | ||
repo: cdt | ||
target: '${{needs.versions.outputs.cdt-target}}' | ||
prereleases: ${{fromJSON(needs.versions.outputs.cdt-prerelease)}} | ||
file: 'cdt_.*amd64.deb' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install CDT | ||
run: apt-get install -y ./cdt*.deb | ||
|
||
- name: Download leap builddir | ||
id: download-leap-build | ||
uses: AntelopeIO/asset-artifact-download-action@v3 | ||
with: | ||
owner: AntelopeIO | ||
repo: leap | ||
file: build.tar.zst | ||
target: ${{needs.versions.outputs.leap-target}} | ||
artifact-name: ${{matrix.platform}}-build | ||
fail-on-missing-target: false | ||
|
||
- name: Extract Leap Build | ||
id: extract-leap-build | ||
run: | | ||
zstdcat build.tar.zst | tar x | ||
pushd build | ||
echo "LEAP_BUILD_PATH=$(pwd)" >> "$GITHUB_OUTPUT" | ||
popd | ||
- name: Build EVM Bridge Contracts | ||
run: | | ||
pushd evm-bridge-contracts | ||
mkdir build | ||
pushd build | ||
cmake -Dleap_DIR=${{ steps.extract-leap-build.outputs.LEAP_BUILD_PATH }}/lib/cmake/leap .. | ||
make -j | ||
- name: EVM Bridge Contracts Tests | ||
run: | | ||
echo "Workflow Stub" | ||
pushd evm-bridge-contracts/build | ||
ctest --output-on-failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters