Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

GitHub Actions Workflow Checks Out to Subdirectory Instead of Workspace Directory

$
0
0

I'm using GitHub Actions to run tests on my Python project. I'm trying to checkout my repository directly into the runner's workspace directory (/home/runner/work/my_repo) instead of a subdirectory (/home/runner/work/my_repo/my_repo).

Here's the relevant part of my workflow file:

name: Run testson: [push, workflow_call]env:  PYTHON_VERSION: '3.9'jobs:  test:    runs-on: ubuntu-latest    steps:    - name: Checkout      uses: actions/checkout@v2      with:        path: .    - name: Set up Python      uses: actions/setup-python@v2      with:        python-version: 3.9    - name: Install dependencies      run: |        python -m pip install --upgrade pip        pip install .        pip install pytest        pip install pytest-mock    - name: Run tests

When I run this workflow, the repository is checked out into a subdirectory named after the repository (/home/runner/work/my_repo/my_repo), not into the runner's workspace directory (/home/runner/work/my_repo) and this causes pytest to not find any tests.

I've tried setting the path parameter to . in the actions/checkout@v2 action to checkout the repository into the runner's workspace directory, but this didn't work.

Does anyone know how I can checkout my repository directly into the runner's workspace directory in a GitHub Actions workflow?


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>