Workflow Container wrong mysql version even though image is 8

I’m trying, really really hard, to make my first CI workflow.

It’s for Laravel with php7.4 & mysql 8 (I need LOAD DATA LOCAL INFILE, that’s why I’m trying to use an image that has it enabled).

The workflow so far, has two issues:

The main issue is, the test that needs load data enabled, always fails (no mysql error, but just the test expectation Failed asserting that null is not null.
In my local environment all tests are passing though… It almost seems as if the code that triggers the csv import, just doesn’t run, so nothing is created and my test gets null back, where it shouldn’t.

Now I have created a mysql docker image, from the container I am using in my local environment, pushed it to Docker Hub and then use it in my workflow.
But when I check the version, I get 5.7 back… I’m at my wits end now.


Run mysql --host mysql --port 3306 -uroot -p -e "SELECT @@global.secure_file_priv"
  mysql --host mysql --port 3306 -uroot -p -e "SELECT @@global.secure_file_priv"
  mysql -V
  shell: sh -e {0}
mysql  Ver 14.14 Distrib 5.7.30, for Linux (x86_64) using  EditLine wrapper
Enter password: 

And here is my workflow:

name: Testing Laravel with MySQL 8
on: [ push, pull_request ]
    name: Laravel Testsuite
    runs-on: ubuntu-latest
      image: kirschbaumdevelopment/laravel-test-runner:7.4

        image: madsem/mysql:8.0.20
          MYSQL_DATABASE: laravel
        options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

      - name: Checkout
        uses: actions/checkout@v2

      - name: mysql check
        run: |
          mysql --host mysql --port 3306 -uroot -p -e "SELECT @@global.secure_file_priv"
          mysql -V

      - name: Get Composer Cache Directory
        id: get-composer-cache
        run: |
          echo "::set-output name=dir::$(composer config cache-files-dir)"

      - name: Cache Composer
        uses: actions/cache@v1
        id: composer-cache
          path: ${{ steps.get-composer-cache.outputs.dir }}
          key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
          restore-keys: |
            ${{ runner.os }}-composer-

      - name: Configure composer for Laravel Nova
        run: composer config "" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_PASSWORD }}"

      - name: Install composer dependencies
        run: composer install --no-progress --prefer-dist --no-interaction --no-suggest --optimize-autoloader --no-scripts

      - name: Clear Config
        run: |
          php artisan config:clear
          php artisan cache:clear

      - name: Prepare the application
        run: |
          cp .env
          php artisan key:generate

      - name: Run Migration
        run: php artisan migrate --force -v

      - name: Test with phpunit
        run: vendor/bin/phpunit

      - name: Run Sensiolabs security checks
        run: |
          test -d security-checker || git clone
          cd security-checker
          composer install
          php security-checker security:check ../composer.lock

Can anybody tell me what I do wrong? :blush:


Maybe you can try to use the “FROM” instruction in the Dockerfile of your image to set the public image “mysql:8.0.20” as the the Base Image.

@brightran, thanks! But I ended up using the Ubuntu 20.04 image Github provides and then configure and restart it there. That works perfectly. :slight_smile: