0
votes

I wrote some code to test my project and I want to run the test on GitHub Actions
I have the following workflow definition.

name : Testing
on: push

jobs:
    registrar:
        runs-on: ubuntu-latest
        steps:
        
        - name: Run Django unit tests
          uses: actions/checkout@v2
            run:|
                pip3 install --user -r requirements.txt
                python3 manage.py makemigrations
                python3 manage.py migrate
                python3 manage.py test

The workflow failed with the following error.

An action could not be found at the URI 'https://api.github.com/repos/actions/checkout/tarball/v1 run:| pip3 install --user -r requirements.txt python3 manage.py makemigrations python3 manage.py migrate python3 manage.py test'

How do I fix this?

1

1 Answers

0
votes

Try this:

name : Testing
on: push

jobs:
    registrar:
        runs-on: ubuntu-latest
        steps:
        
        - name: checkout the repository
          uses: actions/checkout@v2
        - name: Run Django unit tests
          run: |
            pip3 install --user -r requirements.txt
            python3 manage.py makemigrations
            python3 manage.py migrate
            python3 manage.py test

It splits your step into two steps, one for the checkout and one for the tests. The checkout action should be seperate from your custom commands.

It also changes the spacing so that the run has the same intent as the name.

The last thing I changed is that I added a space before the pipe.