Skip to content

#36 improve license #89

#36 improve license

#36 improve license #89

Workflow file for this run

name: Run Tests
on:
push:
branches-ignore:
- develop
- beta
- stable
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: |
sudo apt-get install jq
yarn
yarn build
- name: Run linter
run: |
yarn lint
- name: Run sgx container
run: |
export SGX_WALLET_TAG=1.10.2-develop.6
echo "SGX_WALLET_TAG=$SGX_WALLET_TAG" >> $GITHUB_ENV
bash ./scripts/run_sgx_container.sh $SGX_WALLET_TAG
echo "Waiting for SGX wallet to be ready..."
for i in {1..60}; do
if curl -s -o /dev/null -w "%{http_code}" https://127.0.0.1:1026 2>/dev/null | grep -q "405\|200"; then
echo "SGX wallet is ready after $((i*2)) seconds"
break
fi
echo "Attempt $i: SGX wallet not ready yet..."
sleep 2
done
docker logs sgx-simulator 2>&1 | tail -20 || true
shell: bash
- name: Import ssl certificates
run: |
bash ./scripts/import_ssl_certificates.sh
shell: bash
- name: Import keys
run: |
bash ./scripts/import_sgx_keys.sh
shell: bash
- name: Run skaled container
run: |
export SKALED_RELEASE=5.1.0-develop.38-bite
echo "SKALED_RELEASE=$SKALED_RELEASE" >> $GITHUB_ENV
shell: bash
- name: Run tests
env:
SKALED_RELEASE: ${{ env.SKALED_RELEASE }}
run: |
bash ./scripts/run_test.sh $SKALED_RELEASE
shell: bash
- name: Stop containers
if: always()
run: |
# Stop sgxwallet container
SGX_CONTAINER_ID=$(docker ps -q --filter "ancestor=skalenetwork/sgxwallet_sim:${{ env.SGX_WALLET_TAG }}")
if [ ! -z "$SGX_CONTAINER_ID" ]; then
echo "Stopping sgxwallet container: $SGX_CONTAINER_ID"
docker stop $SGX_CONTAINER_ID
fi
# Stop skaled container
SKALED_CONTAINER_ID=$(docker ps -q --filter "ancestor=skalenetwork/schain:${{ env.SKALED_RELEASE }}")
if [ ! -z "$SKALED_CONTAINER_ID" ]; then
echo "Stopping skaled container: $SKALED_CONTAINER_ID"
docker stop -t 270 $SKALED_CONTAINER_ID
fi
shell: bash
- name: Collect sgxwallet container logs
env:
SGX_WALLET_TAG: ${{ env.SGX_WALLET_TAG }}
if: always()
run: |
CONTAINER_ID=$(docker ps -a -q --filter "ancestor=skalenetwork/sgxwallet_sim:$SGX_WALLET_TAG")
echo "Container ID: $CONTAINER_ID"
docker ps -a
docker logs --details --timestamps --tail=all $CONTAINER_ID > sgxwallet_logs.txt 2>&1
shell: bash
- name: Collect skaled container logs
env:
SKALED_RELEASE: ${{ env.SKALED_RELEASE }}
if: always()
run: |
CONTAINER_ID=$(docker ps -a -q --filter "ancestor=skalenetwork/schain:$SKALED_RELEASE")
echo "Container ID: $CONTAINER_ID"
docker ps -a
docker logs --details --timestamps --tail=all $CONTAINER_ID > skaled_logs.txt 2>&1
shell: bash
- name: Upload sgxwallet logs as artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: sgxwallet-logs
path: sgxwallet_logs.txt
- name: Upload skaled logs as artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: skaled-logs
path: skaled_logs.txt