Can you explain the pros and cons of both solutions?
steps: - uses: actions/checkout@v1 - uses: actions/setup-python@v1 with: python-version: '3.7' - run: python my_script.py
container: python:3.7 runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - run: python my_script.py
Solved! Solved! Go to Solution.
I have a few summary here for your reference:
Thank you for your detailed answer. But I think you miss the main point of my question. I will rephrase.
My job needs Python 3.7 to run. Today I have two solutions: actions/setup-python or container: python:3.7.
In both cases, my job will pass.
What's the pro and cons of these two solutions?
@tetienne Containers are only an option on Linux. If you need to test your python application on Windows or MacOS then using setup-python is the right option. It can also be a lot faster as in many cases you can use a python that is already downloaded on the runner rather than having to wait for a container to download.
Oh I was not aware of container restricted only to Linux host.
I will try to perform some tests to see the speed difference between both. But indeed it makes sense.
Thx for your answer.