This GitHub Actions workflow builds the EOS EVM contract and its associated tests.
This GitHub action will run under the following circumstances:
- When code is pushed to the
main
branch. - When code is pushed to any branch with a name starting with
release/
. - Workflow dispatch event, which is triggered manually using the "Workflow Dispatch" button in the Actions tab of the GitHub repository.
The inputs for this GitHub action are:
DCMAKE_BUILD_TYPE
- defined in the GitHub Action YAML, this sets the build type and determines the level of optimization, debugging information, and other flags; one ofDebug
,Release
,RelWithDebInfo
, orMinSizeRel
.DWITH_TEST_ACTIONS
- defined in the GitHub Action YAML, build with or without code paths intended to be excercised exclusively by tests.GITHUB_TOKEN
- a GitHub Actions intrinsic used to access the repository and other public resources.TRUSTEVM_CI_APP_ID
- the app ID of thetrustevm-ci-submodule-checkout
GitHub App.TRUSTEVM_CI_APP_KEY
- the private key to thetrustevm-ci-submodule-checkout
GitHub App.
These inputs are used in various steps of the workflow to perform actions such as authentication, downloading artifacts, configuring the build, and uploading artifacts.
This workflow performs the following steps:
- Attach Documentation
- Checkout the repo with no submodules.
- Attach an annotation to the GitHub Actions build summary page containing CI documentation.
- EOS EVM Contract Build
This is a build matrix with and without tests enabled.
- Authenticate to the
trustevm-ci-submodule-checkout
GitHub app using the AntelopeIO/github-app-token-action action to obtain an ephemeral token. - Checkout the repo and submodules using the ephemeral token.
- Download the CDT binary using the AntelopeIO/asset-artifact-download-action action.
- Install the CDT binary.
- Build the EOS EVM contract using
make
andcmake
. - Upload the contract build folder to GitHub Actions.
- If tests are enabled, download the
leap-dev
binary using AntelopeIO/asset-artifact-download-action action. - If tests are enabled, install the
leap-dev
binary. - If tests are enabled, build the EOS EVM contract tests using
make
andcmake
. - If tests are enabled, upload the build folder for the contract test code to GitHub Actions.
- If tests are enabled, run them and ignore the outcome.
- If tests are enabled, attach xUnit-formatted test metrics as an artifact.
- Authenticate to the
This workflow produces the following outputs:
- Contract Build Artifacts -
contract.test-actions-off.tar.gz
containing the built contract from thecontract/build
folder withDWITH_TEST_ACTIONS=off
. - Contract Build Artifacts -
contract.test-actions-on.tar.gz
containing the built contract from thecontract/build
folder withDWITH_TEST_ACTIONS=on
. - Contract Test Artifacts -
contract-test.tar.gz
containing the built contract test artifacts from thecontract/tests/build
folder.
📁 Due to actions/upload-artifact issue 39 which has been open for over three years and counting, the archives attached as artifacts will be zipped by GitHub when you download them such that you get a
*.zip
containing the*.tar.gz
. There is nothing anyone can do about this except for Microsoft/GitHub.
This workflow uses the AntelopeIO/github-app-token-action GitHub action to assume the role of a GitHub application installed to the AntelopeIO organization to clone the private submodules. It requests a token from the GitHub app, clones everything using this token under the identity of the app, then the token expires. This is advantageous over a persistent API key from a GitHub service account because this does not consume a paid user seat, the "account" associated with the app cannot be logged into in the GitHub web UI, the app is scoped to exactly the permissions it needs to perform the clones for this repo and nothing more, and the API key expires very quickly so a bad actor who exfiltrates this key from the CI system should find it is not useful.
The downside is that if EOS EVM adds additional private submodules, the GitHub app must be granted permissions to these new submodules. The CI system will not work until this happens.
- asset-artifact-download-action GitHub Action
- github-app-token-action GitHub action
- EOS EVM Documentation
For assistance with the CI system, please open an issue in this repo or reach out in the #help-automation
channel via IM.
Legal notice
This document was generated in collaboration with ChatGPT from OpenAI, a machine learning algorithm or weak artificial intelligence (AI). At the time of this writing, the OpenAI terms of service agreement §3.a states:
Your Content. You may provide input to the Services (“Input”), and receive output generated and returned by the Services based on the Input (“Output”). Input and Output are collectively “Content.” As between the parties and to the extent permitted by applicable law, you own all Input, and subject to your compliance with these Terms, OpenAI hereby assigns to you all its right, title and interest in and to Output.
This notice is required in some countries.