How to checkout at the path for every step?

My current workflow looks something like:

jobs:
  test:
    if: github.event.pull_request.draft == false
    runs-on: ubuntu-latest
    env:
      DEV_KEY: ${{ secrets.FIREBASE_ADMIN_SDK_DEV_KEY }}
    steps:
    - uses: actions/checkout@v2
    - name: Install dependencies
      run: |
        cd infrastructure/google_cloud_platform/firebase/cloud_functions/typescript_cloud_functions/functions
        npm install
    - name: Lint
      run: |
        cd infrastructure/google_cloud_platform/firebase/cloud_functions/typescript_cloud_functions/functions
        npm run lint
    - name: Check for compiling errors
      run: |
        cd infrastructure/google_cloud_platform/firebase/cloud_functions/typescript_cloud_functions/functions
        npm run build
    - name: Run Unit Tests
      run: |
        cd infrastructure/google_cloud_platform/firebase/cloud_functions/typescript_cloud_functions/functions
        npm test
    - name: Run E2E Tests
      run: |
        cd infrastructure/google_cloud_platform/firebase/cloud_functions/typescript_cloud_functions/functions
        echo $DEV_KEY > dev-key.json
        npm run test_e2e

Is there a way to start every time at infrastructure/google_cloud_platform/firebase/cloud_functions/typescript_cloud_functions/functions? There is a path parameter for checkout, but it seems so that this is not the thing I’m searching for

I think defaults.run.working-directory should do what you need.

2 Likes

Yes, this works :+1: Thank you! :pray:

1 Like