2024-03-10 GitHub Actions でディレクトリを指定してコマンド実行
working-directory
を指定すればOK。
jobs:
job1:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./scripts
ref. Workflow syntax for GitHub Actions - GitHub Docs
name: CI
on: [push]
jobs:
phpunit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Symfony
working-directory: ./app
run: cp .env.dev .env
- name: Install Composer Dependencies
working-directory: ./app
run: composer install --prefer-dist
- name: Run Tests
working-directory: ./app
run: php bin/phpunit
ref. github - Running actions in another directory - Stack Overflow