I would like to allow two jobs to run in parallel and both use the same environment.
<code>I have attached a sample github actions .yml file with comments to better explain what I need. I am new to the community so thank you for the help in advance!
I made a simplified code with the areas I need help with below.
</code>
<code>I have attached a sample github actions .yml file with comments to better explain what I need. I am new to the community so thank you for the help in advance!
I made a simplified code with the areas I need help with below.
</code>
I have attached a sample github actions .yml file with comments to better explain what I need. I am new to the community so thank you for the help in advance!
I made a simplified code with the areas I need help with below.
name: Need two jobs to run in parallel and use the same venv
from the first job
on: push
jobs:
install-dependency:
runs-on: ubuntu-latest
<code>steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11.9'
- name: Install Dependencies
run: |
python -m venv venv
#<Save the VENV somehow!>
source venv/bin/activate
pip install -r requirements.txt
</code>
<code>steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11.9'
- name: Install Dependencies
run: |
python -m venv venv
#<Save the VENV somehow!>
source venv/bin/activate
pip install -r requirements.txt
</code>
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11.9'
- name: Install Dependencies
run: |
python -m venv venv
#<Save the VENV somehow!>
source venv/bin/activate
pip install -r requirements.txt
run-pytest:
runs-on: ubuntu-latest
needs: [install-dependency]
steps:
– name: Checkout code
uses: actions/checkout@v4
<code> - name: Setup Python
uses: actions/setup-python@v4
- name: Run Pytest
run: |
source ${{ insert-venv-path }}/bin/activate
pip install pytest
pytest --maxfail=1 --disable-warnings -v
</code>
<code> - name: Setup Python
uses: actions/setup-python@v4
- name: Run Pytest
run: |
source ${{ insert-venv-path }}/bin/activate
pip install pytest
pytest --maxfail=1 --disable-warnings -v
</code>
- name: Setup Python
uses: actions/setup-python@v4
- name: Run Pytest
run: |
source ${{ insert-venv-path }}/bin/activate
pip install pytest
pytest --maxfail=1 --disable-warnings -v
run-other-pytest:
runs-on: ubuntu-latest
needs: [install-dependency]
steps:
– name: Checkout code
uses: actions/checkout@v4
<code> - name: Setup Python
uses: actions/setup-python@v4
- name: Run Pytest
run: |
source ${{ insert-venv-path }}/bin/activate
pip install pytest
pytest --maxfail=1 --disable-warnings -v
</code>
<code> - name: Setup Python
uses: actions/setup-python@v4
- name: Run Pytest
run: |
source ${{ insert-venv-path }}/bin/activate
pip install pytest
pytest --maxfail=1 --disable-warnings -v
</code>
- name: Setup Python
uses: actions/setup-python@v4
- name: Run Pytest
run: |
source ${{ insert-venv-path }}/bin/activate
pip install pytest
pytest --maxfail=1 --disable-warnings -v
<code>
I know github makes it so that every job runs on a different environment but I still thought this was possible. Please correct me if I am wrong.
</code>
<code>
I know github makes it so that every job runs on a different environment but I still thought this was possible. Please correct me if I am wrong.
</code>
I know github makes it so that every job runs on a different environment but I still thought this was possible. Please correct me if I am wrong.