Why doesn’t Github Workflow start?

Asked

Viewed 82 times

4

I created in my repository (currently, Github master branch) a Workflow to run the tests of my Python application, using the pytest. I set it to run on ubuntu-latest in Python versions (3.6, 3.7 and 3.8) whenever a push or a pull request.

See below my file .yml:

name: Python Package

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ['3.6', '3.7', '3.8']

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt
    - name: Test with pytest
      run: |
        pytest tests -v -s
    - name: Install package
      run: |
        pip install FlightRadarAPI

The problem is that Github does not boot Workflow and keeps appearing on the screen the following message, below the logo:

This workflow has no runs yet.

I added a file README.md to update the repository and see if Workflow was booting but continued the same way. What’s going on? What am I doing wrong?

1 answer

7


This is what you get by copying and pasting. : P

You’re saying explicitly to run this workflow only in the branch main:

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

This field should obviously be followed to the letter. But your repository (as link pointed out in the question) is in the branch master.

  • Or you change the branch of master for main.
  • Or you change the configuration of workflow, to rotate in the branch master instead of main.
  • 1

    "That’s what comes of copying and pasting". For a moment I thought you were kkk seer. Thanks for the reply.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.