Theo
Theo

Reputation: 23

How to implement ./cloud_sql_proxy in GitHub Actions?

jobs:
  job1:
    runs-on: ubuntu-latest
    
    steps:
    - uses: actions/checkout@v2

    - name: Download Cloud SQL Auth Proxy
      run: |
        wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 -O cloud_sql_proxy
        chmod +x cloud_sql_proxy

  job2:
    needs: job1
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: ./cloud_sql_proxy \
              -instances=...

I got this error:

./cloud_sql_proxy: No such file or directory

I wanna separate job1 and job2.

How can I use ./cloud_sql_proxy command in job2?

Upvotes: 2

Views: 338

Answers (1)

John Hanley
John Hanley

Reputation: 81464

Github jobs do not share files or data unless you take action to do so. One of the reasons is they can run in parallel on different systems/containers/computers.

There are several options. The easiest is to create a step in job2 that does the same download as the step in job1. Other options include workflow artifacts (upload and download) and cache.

Upvotes: 1

Related Questions