build(deps-dev): bump pytest from 8.3.1 to 8.3.2 #327
Workflow file for this run
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
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
shared: | |
uses: pantos-io/ci-workflows/.github/workflows/python-ci.yml@v1 | |
secrets: inherit | |
docker-build: | |
name: Build Docker images | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | |
with: | |
egress-policy: block | |
allowed-endpoints: > | |
api.github.com:443 | |
auth.docker.io:443 | |
azure.archive.ubuntu.com:80 | |
deb.debian.org:80 | |
esm.ubuntu.com:443 | |
files.pythonhosted.org:443 | |
ghcr.io:443 | |
github.com:443 | |
index.docker.io:443 | |
motd.ubuntu.com:443 | |
packages.microsoft.com:443 | |
pkg-containers.githubusercontent.com:443 | |
production.cloudflare.docker.com:443 | |
pypi.org:443 | |
registry-1.docker.io:443 | |
repo.anaconda.com:443 | |
- uses: actions/checkout@v4 | |
- uses: actions/checkout@v4 | |
with: | |
repository: pantos-io/ethereum-contracts | |
path: ethereum-contracts | |
sparse-checkout: docker-compose.yml | |
- name: Create local signer_key | |
run: | | |
ssh-keygen -t ed25519 -f signer_key.pem -N '' | |
chmod 777 signer_key.pem | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0 | |
id: buildx | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-v1.0-service-node-${{ github.ref_name }} | |
restore-keys: | | |
${{ runner.os }}-buildx-v1.0-service-node- | |
- name: Check docker config and disable live reload | |
run: | | |
cat /etc/docker/daemon.json | |
echo '{ "live-restore": false }' | sudo tee /etc/docker/daemon.json | |
sudo systemctl reload docker | |
make check-swarm-init | |
- name: Run Docker | |
run: | | |
docker compose -f ethereum-contracts/docker-compose.yml up -d --no-build --wait | |
env: | |
DOCKER_TAG: "1.1.2" | |
- name: Build and load | |
run: | | |
docker buildx bake \ | |
--set "*.cache-from=type=local,src=/tmp/.buildx-cache" \ | |
--set "*.cache-to=type=local,dest=/tmp/.buildx-cache-new" \ | |
--set "*.platform=linux/amd64" \ | |
--builder ${{ steps.buildx.outputs.name }} \ | |
-f docker-compose.yml \ | |
--load | |
- name: Test image | |
timeout-minutes: 10 | |
run: | | |
make docker ARGS="-d --no-build --wait" | |
- name: Dump service node logs | |
if: always() | |
run: | | |
docker compose logs || true | |
- name: Tear down | |
run: | | |
docker compose down -v | |
- name: Dump ethereum contract logs | |
if: always() | |
run: | | |
docker compose logs || true | |
working-directory: ethereum-contracts | |
- name: Move cache | |
run: | | |
rm -rf /tmp/.buildx-cache | |
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | |
build: | |
uses: ./.github/workflows/build.yml | |
with: | |
architecture: amd64 | |
install: | |
needs: [build] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-20.04 | |
- ubuntu-22.04 | |
# TODO: Fix the installation on ubuntu-24.04 | |
# - ubuntu-24.04 | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/checkout@v4 | |
with: | |
repository: pantos-io/ethereum-contracts | |
path: ethereum-contracts | |
sparse-checkout: docker-compose.yml | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
id: buildx | |
- name: Check docker config and disable live reload | |
run: | | |
cat /etc/docker/daemon.json | |
echo '{ "live-restore": false }' | sudo tee /etc/docker/daemon.json | |
sudo systemctl reload docker | |
make check-swarm-init | |
- name: Run Docker | |
run: | | |
docker compose -f ethereum-contracts/docker-compose.yml up -d --no-build --wait | |
env: | |
DOCKER_TAG: "1.1.2" | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-amd64 | |
path: build | |
- name: Preconfigure package | |
run: | | |
echo 'pantos-service-node-full pantos/service-node/create_signer_key boolean true' | sudo debconf-set-selections; | |
echo 'pantos-service-node-full pantos/service-node/signer_key_password string 1234' | sudo debconf-set-selections; | |
echo 'pantos-service-node-full pantos/common/configure_postgresql boolean true' | sudo debconf-set-selections; | |
echo 'pantos-service-node-full pantos/common/configure_rabbitmq boolean true' | sudo debconf-set-selections; | |
echo 'pantos-service-node-full pantos/common/start_services boolean true' | sudo debconf-set-selections; | |
- name: Copy files from eth-data and bnb-data | |
run: | | |
sudo mkdir -p /etc/pantos | |
sudo chmod 777 /etc/pantos | |
docker compose cp eth:/data/keystore /etc/pantos/keystore.eth | |
docker compose cp eth:/data/ETHEREUM.env /etc/pantos/ETHEREUM.env | |
docker compose cp bnb:/data/keystore /etc/pantos/keystore.bnb | |
docker compose cp bnb:/data/BNB.env /etc/pantos/BNB.env | |
working-directory: ethereum-contracts | |
- name: Set env | |
run: | | |
sudo cp ./service-node-config.local.env /etc/pantos/service-node-config.env | |
# Append the new addresses from the copied env files | |
sudo cat /etc/pantos/ETHEREUM.env | sudo tee -a /etc/pantos/service-node-config.env > /dev/null | |
sudo cat /etc/pantos/BNB.env | sudo tee -a /etc/pantos/service-node-config.env > /dev/null | |
sudo chmod 644 /etc/pantos/service-node-config.env | |
- name: Install Debian package | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y ./build/*.deb curl | |
# Check service is running | |
- name: Check service is running | |
timeout-minutes: 5 | |
run: | | |
# Wait for the service to start | |
while ! sudo systemctl is-active --quiet pantos-service-node-server; do | |
echo "Server is not running, retrying in 1 second." | |
sleep 1 | |
done | |
echo "Server is running" | |
while ! sudo systemctl is-active --quiet pantos-service-node-celery; do | |
echo "Celery is not running, retrying in 1 second." | |
sleep 1 | |
done | |
echo "Celery is running" | |
# Wait for curl to be positive | |
while true; do | |
response=$(curl -s -o /dev/null -w '%{http_code}' 'http://localhost:8080/bids?source_blockchain=0&destination_blockchain=1') | |
if [ "$response" -eq 200 ]; then | |
echo "Received 200 response, exiting." | |
break | |
else | |
echo "Did not receive 200 response, retrying in 1 second." | |
sleep 1 | |
fi | |
done | |
echo "Service is up and running" | |
- name: Print logs | |
if: always() | |
run: | | |
sudo systemctl status pantos-service-node-server || true | |
sudo systemctl status pantos-service-node-celery || true | |
sudo journalctl -u pantos-service-node-server || true | |
sudo journalctl -u pantos-service-node-celery || true | |
# Print the contents of every file in /var/log/pantos | |
sudo find /var/log/pantos -type f -exec sudo cat {} \; | |
- name: Fix permissions for upload | |
if: always() | |
run: | | |
sudo chmod -R 777 /var/log/pantos | |
sudo chmod -R 777 /etc/pantos | |
- name: Upload logs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: install-logs-${{ matrix.os }} | |
path: /var/log/pantos | |
- name: Upload env config | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: env-config-${{ matrix.os }} | |
path: /etc/pantos | |
- name: Dump ethereum contract logs | |
if: always() | |
run: | | |
docker compose logs || true | |
working-directory: ethereum-contracts |