purple-cricket-59216
02/01/2024, 2:38 PMmillions-furniture-75402
02/01/2024, 2:52 PMrun
keyword isn't doing what you think. Each run is a separate process, you won't still be inside your venv
on the next step.
In this case, I think you want the setup-python
action which it setup python in a runner and persist that runtime across steps: https://github.com/actions/setup-python
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
https://www.pulumi.com/docs/using-pulumi/continuous-delivery/github-actions/dry-keyboard-94795
02/01/2024, 3:01 PMvenv/bin/pip install -r requirements.txt
purple-cricket-59216
02/01/2024, 3:19 PMpurple-cricket-59216
02/01/2024, 3:20 PMname: Pulumi
on:
- pull_request
jobs:
preview:
name: Preview
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-region: ${{ secrets.AWS_REGION }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- run: python3 -m venv venv
- run: . venv/bin/activate
- run: which python
- run: python --version
- run: pip install -r requirements.txt
- uses: pulumi/actions@v3
with:
command: preview
stack-name: org/stackname # When using an individual account, only use stack-name.
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
echoing-dinner-19531
02/02/2024, 1:46 PM- run: . venv/bin/activate
- run: which python
- run: python --version
- run: pip install -r requirements.txt
you need something like:
- run: |
. venv/bin/activate
pip install -r requirements.txt
bumpy-glass-30283
02/04/2024, 2:45 PM- run: python3 -m venv venv && source venv/bin/activate && which python && python --version && pip install -r requirements.txt