@liweintu the fix I proposed would work, but effectively they are the same of deleting the workflow file.
Here I have two alternatives:
-
since not all tests require CUDA, just mark those for which is necessary with @pytest.mark.cuda, and filter them in conftest.py according to the value of the environment variable, within pytest_runtest_setup
-
f you want to run this very same workflow file on a self-hosted runner, then you would have to do something more complex: I don't believe you can access the underlying env vars by default, since for the GitHub runners there are the Variables for that, and it is written explicitly in the docs for the env context
It does not contain variables inherited by the runner process.
However, you could run a first preliminary job, read the environment variable within bash code, and set in the $GITHUB_ENV file, this should make it available in the env context (I'm not completely sure myself, I should test it)
Option 1. is much more reasonable to me, because it is more flexible (you could still run some tests everywhere), it's defined in Python, so you're already familiar with it (instead of looking around in GitHub docs), and you can test it offline on various systems, without having to fiddle with GitHub actions.
Originally posted by @alecandido in #24 (review)
Here I have two alternatives:
since not all tests require CUDA, just mark those for which is necessary with
@pytest.mark.cuda, and filter them inconftest.pyaccording to the value of the environment variable, withinpytest_runtest_setupf you want to run this very same workflow file on a self-hosted runner, then you would have to do something more complex: I don't believe you can access the underlying env vars by default, since for the GitHub runners there are the Variables for that, and it is written explicitly in the docs for the
envcontextHowever, you could run a first preliminary job, read the environment variable within bash code, and set in the
$GITHUB_ENVfile, this should make it available in theenvcontext (I'm not completely sure myself, I should test it)Option 1. is much more reasonable to me, because it is more flexible (you could still run some tests everywhere), it's defined in Python, so you're already familiar with it (instead of looking around in GitHub docs), and you can test it offline on various systems, without having to fiddle with GitHub actions.
Originally posted by @alecandido in #24 (review)