-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: We want to test that latests released binaries can be installed and work fine on different oses. Currently we support only Fedora and Ubuntu Solution: Add github actions that run docker dontainer with given os and install and execute each binary in it. Currently we run checks in parallel, 3 jobs per os.
- Loading branch information
1 parent
6deb063
commit d78a0b7
Showing
9 changed files
with
202 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Test Tezos binaries | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
push: | ||
branches: | ||
- PruStephan/Add_tests_for_packages | ||
|
||
jobs: | ||
test_binaries: | ||
name: Install and test binaries | ||
runs-on: [self-hosted, Linux, X64, nix-with-docker] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Test fedora binaries | ||
run: nix develop .#buildkite -c ./docker/tests/scripts/test-fedora-binaries.sh | ||
|
||
- name: Test ubuntu binaries | ||
run: nix develop .#buildkite -c ./docker/tests/scripts/test-ubuntu-binaries.sh | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"released": [ | ||
"tezos-baking", | ||
"tezos-sapling-params", | ||
"tezos-client", | ||
"tezos-admin-client", | ||
"tezos-node", | ||
"tezos-signer", | ||
"tezos-codec", | ||
"tezos-baker-PtMumbai", | ||
"tezos-accuser-PtMumbai", | ||
"tezos-smart-rollup-client-PtMumbai", | ||
"tezos-smart-rollup-node-PtMumbai", | ||
"tezos-baker-PtNairob", | ||
"tezos-accuser-PtNairob", | ||
"tezos-smart-rollup-client-PtNairob", | ||
"tezos-smart-rollup-node-PtNairob" | ||
], | ||
"candidates": [ | ||
"tezos-smart-rollup-client-Proxford", | ||
"tezos-smart-rollup-client-PtNairob", | ||
"tezos-smart-rollup-node-Proxford", | ||
"tezos-smart-rollup-node-PtNairob", | ||
"tezos-baking", | ||
"tezos-sapling-params", | ||
"tezos-accuser-Proxford", | ||
"tezos-baker-Proxford", | ||
"tezos-accuser-PtNairob", | ||
"tezos-baker-PtNairob", | ||
"tezos-node", | ||
"tezos-dac-node", | ||
"tezos-dac-client", | ||
"tezos-codec", | ||
"tezos-signer", | ||
"tezos-admin-client", | ||
"tezos-client" | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# SPDX-FileCopyrightText: 2023 Oxhead Alpha | ||
# SPDX-License-Identifier: LicenseRef-MIT-OA | ||
|
||
ARG dist | ||
FROM fedora:${dist} | ||
|
||
WORKDIR /tezos-packaging/docker | ||
|
||
RUN dnf update -y | ||
RUN dnf install -y python3-devel python3-setuptools 'dnf-command(copr)' | ||
|
||
ARG repo | ||
RUN dnf copr enable -y @Serokell/${repo} | ||
|
||
ENV IS_RELEASED=${repo} | ||
|
||
COPY docker/tests/test-fedora-binaries.py /tezos-packaging/docker/tests/test-fedora-binaries.py | ||
COPY binaries.json /tezos-packaging/binaries.json | ||
CMD [ "python3", "/tezos-packaging/docker/tests/test-fedora-binaries.py"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# SPDX-FileCopyrightText: 2023 Oxhead Alpha | ||
# SPDX-License-Identifier: LicenseRef-MIT-OA | ||
|
||
ARG dist | ||
FROM ubuntu:${dist} | ||
|
||
WORKDIR /tezos-packaging/docker | ||
|
||
RUN apt update -y | ||
RUN apt install -y python3-all python3-setuptools software-properties-common | ||
|
||
ARG repo | ||
RUN add-apt-repository -yu ppa:serokell/${repo} | ||
|
||
ENV IS_RELEASED=${repo} | ||
|
||
COPY docker/tests/test-ubuntu-binaries.py /tezos-packaging/docker/tests/test-ubuntu-binaries.py | ||
COPY binaries.json /tezos-packaging/binaries.json | ||
CMD [ "python3", "/tezos-packaging/docker/tests/test-ubuntu-binaries.py"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: 2023 Oxhead Alpha | ||
# SPDX-License-Identifier: LicenseRef-MIT-OA | ||
|
||
for version in $(jq -r '.fedora[]' docker/supported_versions.json); do | ||
docker build --build-arg dist="$version" --build-arg repo="Tezos" -t fedora-test -f docker/tests/Dockerfile-fedora-test . | ||
docker run fedora-test | ||
docker build --build-arg dist="$version" --build-arg repo="Tezos-rc" -t fedora-test -f docker/tests/Dockerfile-fedora-test . | ||
docker run fedora-test | ||
done |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: 2023 Oxhead Alpha | ||
# SPDX-License-Identifier: LicenseRef-MIT-OA | ||
|
||
set -e | ||
|
||
for version in $(jq -r '.ubuntu[]' docker/supported_versions.json); do | ||
docker build --build-arg dist="$version" --build-arg repo="tezos" -t ubuntu-test -f docker/tests/Dockerfile-ubuntu-test . | ||
docker run fedora-test | ||
docker build --build-arg dist="$version" --build-arg repo="tezos-rc" -t ubuntu-test -f docker/tests/Dockerfile-ubuntu-test . | ||
docker run ubuntu-test | ||
done |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# SPDX-FileCopyrightText: 2023 Oxhead Alpha | ||
# SPDX-License-Identifier: LicenseRef-MIT-OA | ||
|
||
import subprocess | ||
import sys | ||
import json | ||
import os | ||
|
||
|
||
def test(binaries): | ||
subprocess.run("dnf update -y", shell=True, capture_output=True) | ||
for binary in binaries: | ||
try: | ||
subprocess.run( | ||
f"dnf install -y {binary}", shell=True, capture_output=True, check=True | ||
) | ||
if binary != 'tezos-sapling-params' and binary != 'tezos-baking': | ||
print(f"{binary}: ", end="", flush=True) | ||
subprocess.check_call(f"{binary.replace('tezos', 'octez')} --version", shell=True) | ||
except Exception as e: | ||
print(f"Exception happened when trying to execute tests for {binary}.\n") | ||
raise e | ||
|
||
|
||
if __name__ == "__main__": | ||
data = {} | ||
with open("/tezos-packaging/binaries.json") as f: | ||
data = json.load(f) | ||
|
||
binaries = [] | ||
is_released = os.environ["IS_RELEASED"] | ||
if is_released == "Tezos": | ||
binaries = data["released"] | ||
elif is_released == "Tezos-rc": | ||
binaries = data["candidates"] | ||
else: | ||
raise "Incorrect argument" | ||
|
||
test(binaries) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# SPDX-FileCopyrightText: 2023 Oxhead Alpha | ||
# SPDX-License-Identifier: LicenseRef-MIT-OA | ||
|
||
import subprocess | ||
import sys | ||
import json | ||
import os | ||
|
||
|
||
def test(binaries): | ||
subprocess.run("apt update -y", shell=True, capture_output=True) | ||
for binary in binaries: | ||
try: | ||
subprocess.run( | ||
f"apt install -y {binary.lower()}", shell=True, capture_output=True, check=True | ||
) | ||
if binary != 'tezos-sapling-params' and binary != 'tezos-baking': | ||
print(f"{binary}: ", end="", flush=True) | ||
subprocess.check_call(f"{binary.replace('tezos', 'octez')} --version", shell=True) | ||
except Exception as e: | ||
print(f"Exception happened when trying to execute tests for {binary}.\n") | ||
raise e | ||
|
||
|
||
if __name__ == "__main__": | ||
data = {} | ||
with open("/tezos-packaging/binaries.json") as f: | ||
data = json.load(f) | ||
|
||
binaries = [] | ||
is_released = os.environ["IS_RELEASED"] | ||
if is_released == "tezos": | ||
binaries = data["released"] | ||
elif is_released == "tezos-rc": | ||
binaries = data["candidates"] | ||
else: | ||
raise "Incorrect argument" | ||
|
||
test(binaries) |