hoverkraft-tech / compose-action

This action runs your docker-compose file and clean up before action finished
https://github.com/marketplace/actions/docker-compose-action
MIT License
151 stars 24 forks source link

Unable to use env variables #25

Closed jkobus closed 1 year ago

jkobus commented 1 year ago

I get an error saying:

The workflow is not valid. .github/workflows/tests.yaml (Line: 28, Col: 17): A mapping was not expected

File:

name: "Tests"
on:
  pull_request:
  push:
    branches:
      - master
env:
  fail-fast: true

permissions:
  contents: read

jobs:
  test:
    name: "Testing"
    runs-on: ubuntu-latest
    continue-on-error: false
    steps:
      - uses: actions/checkout@v3
      - uses: isbang/compose-action@v1.4.1
        with:
          compose-file: |
            docker-compose.yml
            docker-compose.override.yml
          down-flags: "--volumes"
          services: |
            php
          env:
            TEST: 1

      - name: PHP Unit
        if: always() && steps.install.outcome == 'success'
        run: docker compose exec php bin/phpunit
jkobus commented 1 year ago

If anyone finds this, I had a bad indent, the "env" section should be on the same level as "with". It was hard to spot though.