<p>I’ve just started exploring Github actions however I’ve found myself placing a command in multiple places.</p>
<p>I have a PHP project where the <code>composer.json</code> is not in the root, my structure looks like:</p>
<pre><code class="lang-auto">my-project:
readme.md
app:
composer.json
</code></pre>
<p>Obviously there is more to it and there is a reason why, but my <code>composer.json</code> sits in a subdirectory called ‘app’. As a result in my workflow, I have to cd into that folder every time to run a command:</p>
<pre><code class="lang-auto">name: CI
on: [push]
jobs:
phpunit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Symfony
run: |
cd app
cp .env.dev .env
- name: Install Composer Dependencies
run: |
cd app
composer install --prefer-dist
- name: Run Tests
run: |
cd app
php bin/phpunit
</code></pre>
<p>How can I remove the <code>cd app</code> in every stage?</p>