Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jmacdiarmid's avatar

Github Actions error - Every step must define a 'uses' or 'run' key

I'm very new to Github actions and feeling my way around in the dark. I'm getting this error in my script when attempting to install mysql and php. Can someone tell me what I'm doing wrong? Here is my code.

# This is a basic workflow to help you get started with Actions
name: Deploy Application

# Controls when the workflow will run
on:

  # Triggers the workflow on push request events but only for the develop branch
  push:
    branches: [ develop ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  app-tests:
    runs-on: ubuntu-latest
    services:
        mysql:
          image: mysql:5.7
          env:
            MYSQL_ALLOW_EMPTY_PASSWORD: yes
            MYSQL_DATABASE: test_db
          ports:
            - 3306
          options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

    steps:
      - name: Checkout
      - uses: actions/checkout@v2

      - name: Setup PHP
        uses: shivammathur/setup-php@master
        with:
          php-version: 7.4
          extensions: mbstring, ctype, fileinfo, openssl, PDO, bcmath, json, tokenizer, xml

0 likes
2 replies
jmacdiarmid's avatar

Thank you! I see what I did. It's working now. :)

Please or to participate in this conversation.