More preparations/refactoring to run in release container #37
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: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
permissions: | |
contents: read | |
env: | |
PYTHON_VERSION: 3.10 | |
PYTHON_VERSION_FULL: 3.10.14 | |
jobs: | |
unit_tests: | |
runs-on: ubuntu-22.04 | |
container: | |
image: erlang:24.2.2 | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Compile | |
run: make compile | |
- | |
name: Run unit tests | |
run: make test_unit | |
common_tests: | |
runs-on: ubuntu-22.04 | |
container: | |
image: erlang:24.2.2 | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Install Python dependencies | |
run: | | |
apt-get update | |
apt-get install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev | |
apt-get install -y libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev | |
- | |
name: Download Python sources | |
run: | | |
# We cannot use actions/setup-python, because it cannot install new python in erlang:24.2.2 image | |
wget https://www.python.org/ftp/python/${{env.PYTHON_VERSION_FULL}}/Python-${{env.PYTHON_VERSION_FULL}}.tgz | |
tar -xf Python-${{env.PYTHON_VERSION_FULL}}.tgz | |
- | |
name: Compile and install Python | |
run: | | |
cd Python-${{env.PYTHON_VERSION_FULL}} | |
./configure --enable-optimizations | |
make -j $(nproc) | |
make altinstall | |
ln -s /usr/local/bin/python${{env.PYTHON_VERSION}} /usr/local/bin/python | |
ln -s /usr/local/bin/pip${{env.PYTHON_VERSION}} /usr/local/bin/pip | |
- | |
name: Compile SWM | |
run: | | |
make compile | |
make release | |
- | |
name: Prepate cloud gate | |
run: | | |
git config --global url.https://github.com/.insteadOf git://github.com/ | |
mkdir _build/ct-tests | |
git clone https://github.com/openworkload/swm-cloud-gate.git _build/ct-tests/swm-cloud-gate | |
ls -l _build/ct-tests | |
cd _build/ct-tests/swm-cloud-gate | |
make prepare-venv | |
. .venv/bin/activate | |
- | |
name: Generate keys | |
run: | | |
export USER=test | |
./scripts/setup-skyport-dev.sh | |
- | |
name: Run ct tests | |
run: | | |
export SWM_GATE_DIR=$(pwd)/_build/ct-tests/swm-cloud-gate | |
make test_ct |