forked from avocado-framework/avocado
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: fix use of different OS images for egg and version tasks
The "version" and "egg" tasks are not effectively setting the container image that should be used. This effectively means that instead of covering a number of different platforms, it's re-running the same checks on the base OS given in the "runs-on" setting. These container images for the different OSs may use either DNF or APT as a package manager, and may or may not have Python or setuptools. In theory: * it should be a matter of setting the "container" and then "image" directives on the GitHub actions YAML * have a common script that conditionally installs the needed packages In practice, GH Actions is terminating the execution of the script given in "run" when it has conditionals in varied ways: * fedora:37 Run if python3 -c "import setuptools"; then Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'setuptools' 4.18.0 Installed: dnf-0:4.18.0-2.fc37.noarch at Sun Nov 26 05:48:57 2023 Built : Fedora Project at Thu Oct 19 09:04:15 2023 Installed: rpm-0:4.18.2-1.fc37.x86_64 at Sun Nov 26 05:48:56 2023 Built : Fedora Project at Mon Nov 13 15:50:44 2023 Error: The operation was canceled. * ubuntu:20.04 'build/scripts-3.8' does not exist -- can't clean it Error: The operation was canceled. I've tried to reproduce the behavior on the same images, using the same shells, and the same command to execute the shells (incuding "bash ... -e -o pipefail", etc), but couldn't. In the end, this change expands the tasks, each with its own Operating System. While doing that it breaks the installation of the Python dependencies into their own step. Because ubuntu 21.10 is EOLed, it was updated to 22.04. Because Debian 10 has Python 3.7, no longer supported in Avocado, it was bumped to Debian 12. Signed-off-by: Cleber Rosa <[email protected]>
- Loading branch information
Showing
3 changed files
with
213 additions
and
48 deletions.
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,14 @@ | ||
name: Egg | ||
description: Test running avocado from eggs | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Test running avocado from eggs | ||
shell: sh | ||
run: | | ||
python3 setup.py bdist_egg | ||
mv dist/avocado_framework-*egg /tmp | ||
python3 setup.py clean --all | ||
python3 -c 'import sys; import glob; sys.path.insert(0, glob.glob("/tmp/avocado_framework-*.egg")[0]); from avocado.core.main import main; sys.exit(main())' run /bin/true | ||
cd /tmp | ||
python3 -c 'import sys; from pkg_resources import require; require("avocado-framework"); from avocado.core.main import main; sys.exit(main())' run /bin/true |
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,10 @@ | ||
name: Version | ||
description: Installs and run avocado --version | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Install and run avocado --version | ||
shell: sh | ||
run: | | ||
python3 setup.py develop --user | ||
python3 -m avocado --version |
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