為了讓我的專案運行,我需要運行一個構建我的 Cmake 檔案夾的腳本,所以當我使用 git 操作執行 Ci 時,我需要運行它:
cd app/src/main/cpp
比
sh build_cmake.sh
我有類似的東西:
- 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
顯然那是行不通的,我的目標怎么能實作?
uj5u.com熱心網友回復:
您可以將兩個命令合二為一run:
- name: running script
run: |
cd app/src/main/cpp
sh build_cmake.sh
另一種解決方法是使用working-directory(https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun)屬性:
- name: running script
working-directory: app/src/main/cpp
run: |
sh build_cmake.sh
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/490908.html
