Home > OS >  Running sh as part of assembling android project on git action yml
Running sh as part of assembling android project on git action yml

Time:06-13

In order for my project to run i need to run a script that building my Cmake folder, so when i do Ci with git action i need to run this :

cd app/src/main/cpp

than

sh build_cmake.sh

I have something like that :

  - name: Check out repository code
    uses: actions/checkout@v3
  - name: List files in the repository
    run: |
      ls ${{ github.workspace }}
  - name: Setting up Cmake
    run: |
      cd app/src/main/cpp  - name: Setting up Cmake
  - name: running script
    run: |
      sh build_cmake.sh

obviously that is not working, how my goal can be achieve?

CodePudding user response:

You can put both commands in one run:

  - name: running script
    run: |
      cd app/src/main/cpp
      sh build_cmake.sh

Another way to solve is to use working-directory (https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun) property:

  - name: running script
    working-directory: app/src/main/cpp
    run: |
      sh build_cmake.sh
  • Related