Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Could not open requirements file in github actions

I am trying to setup a github workflow (first time)

but keep getting this error

/opt/hostedtoolcache/Python/3.10.12/x64/bin/python -m pip install -r requirements.txt
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
Error: ERROR: Action failed during dependency installation attempt with error: The process '/opt/hostedtoolcache/Python/3.10.12/x64/bin/python' failed with exit code 1

you can view my director structure here
and github workflow file

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

name: testing
on: [push,pull_request]
run-name: running tests for searchenginepy
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: setup python
        uses: actions/setup-python@v4
        with:
          python-version: '3.10' # install the python version needed
          
      - name: Install dependencies
        uses: py-actions/py-dependency-install@v4
        with:
              path: "requirements.txt"
          
      - name: run tests # run main.py
        working-directory: tests
        run: python -m unittest discover
          

I have tried

pip install .
pip install -r .github/workflows/requirements.txt

I am also not sure about the unittest directory because that needs to be run in the tests folder

>Solution :

Please just add checkout step - uses: actions/checkout@v3

name: testing
on: [push,pull_request]
run-name: running tests for searchenginepy
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: setup python
        uses: actions/setup-python@v4
        with:
          python-version: '3.10' # install the python version needed
          
      - name: Install dependencies
        uses: py-actions/py-dependency-install@v4
        with:
              path: "requirements.txt"
          
      - name: run tests # run main.py
        working-directory: tests
        run: python -m unittest discover
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading