Add build CI job
Some checks failed
Build metamask extension / Build metamask extension (pull_request) Failing after 10m41s
DIN Payments Stack Test / Run DIN payments stack test (pull_request) Successful in 1h12m42s

This commit is contained in:
David Boreham 2024-06-03 07:26:29 -06:00
parent 5960f0e21d
commit 35ec0edb3f
2 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,43 @@
name: Build metamask extension
on:
pull_request:
branches: '*'
push:
branches:
- main
jobs:
test:
name: "Build metamask extension"
runs-on: ubuntu-latest
steps:
- name: "Clone project repository"
uses: actions/checkout@v3
# At present the stock setup-python action fails on Linux/aarch64
# Conditional steps below workaroud this by using deadsnakes for that case only
- name: "Install Python for ARM on Linux"
if: ${{ runner.arch == 'arm64' && runner.os == 'Linux' }}
uses: deadsnakes/action@v3.0.1
with:
python-version: '3.8'
- name: "Install Python cases other than ARM on Linux"
if: ${{ ! (runner.arch == 'arm64' && runner.os == 'Linux') }}
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: "Print Python version"
run: python3 --version
- name: "Install yarn"
run: npm install --global yarn
- name: "Set Gitea access token"
env:
TOKEN: ${{ secrets.CICD_REPO_TOKEN }}
run: |
git config --global url."https://$TOKEN:@git.vdb.to/".insteadOf https://git.vdb.to/
- name: "Install stack orchestrator"
run: ./scripts/install-so.sh
- name: "Run build"
run: |
PATH=$PATH:~/bin
./build/build-metamask-extension.sh

View File

@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -e
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi
SO_COMMAND=laconic-so
test_name="DIN payments stack deploy test"
echo "Running ${test_name}"
stack_name=$(pwd)/stack-orchestrator/stacks/din-payments
test_fail_exit () {
local fail_message=$1
echo "${test_name}: ${fail_message}"
echo "${test_name}: FAILED"
exit 1
}
# Sanity check the stack dir exists
if [ ! -d "${stack_name}" ]; then
test_fail_exit "stack directory not present"
exit 1
fi
# Set a non-default repo dir
export CERC_REPO_BASE_DIR=~/stack-orchestrator-test/repo-base-dir
echo "Cloning repositories into: $CERC_REPO_BASE_DIR"
rm -rf $CERC_REPO_BASE_DIR
mkdir -p $CERC_REPO_BASE_DIR
$SO_COMMAND --stack ${stack_name} setup-repositories
echo "Running build script"
cd ${CERC_REPO_BASE_DIR}/metamask-extension
./nitro-build.sh