From fa109415beaf8a10f158eae019d53bcfa8b18651 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Wed, 31 Jul 2024 08:56:01 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20actionlint=E3=82=92=E5=B0=8E=E5=85=A5?= =?UTF-8?q?=20(#42)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/actionlint.yml | 24 ++++++++++++++++++++++++ .github/workflows/build.yml | 15 +++++++-------- 2 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/actionlint.yml diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml new file mode 100644 index 0000000..aa4773f --- /dev/null +++ b/.github/workflows/actionlint.yml @@ -0,0 +1,24 @@ +name: actionlint + +on: + - push + - pull_request + +jobs: + actionlint: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Update ShellCheck + run: | + sudo apt-get update + sudo apt-get install -y shellcheck + shellcheck -V + + - name: actionlint + run: | + bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) + ./actionlint -color diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6dfed5b..3010bad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,8 +2,6 @@ name: Build C++ Shared Library on: push: - branches: - # - main release: types: - published @@ -297,13 +295,14 @@ jobs: rm -rf ${{ matrix.result_dir }}/${{ matrix.artifact_name }} rm -rf ./artifact # Set library name - if [[ ${{ matrix.artifact_name }} == onnxruntime-win-* ]]; then + ARTIFACT_NAME=${{ matrix.artifact_name }} + if [[ "$ARTIFACT_NAME" == onnxruntime-win-* ]]; then ONNXRUNTIME_NAME=onnxruntime.dll - elif [[ ${{ matrix.artifact_name }} == onnxruntime-linux-* ]]; then + elif [[ "$ARTIFACT_NAME" == onnxruntime-linux-* ]]; then ONNXRUNTIME_NAME=libonnxruntime.so.${{ env.ONNXRUNTIME_VERSION }} - elif [[ ${{ matrix.artifact_name }} == onnxruntime-android-* ]]; then + elif [[ "$ARTIFACT_NAME" == onnxruntime-android-* ]]; then ONNXRUNTIME_NAME=libonnxruntime.so - elif [[ ${{ matrix.artifact_name }} == onnxruntime-osx-* ]] || [[ ${{ matrix.artifact_name }} == onnxruntime-ios-* ]]; then + elif [[ "$ARTIFACT_NAME" == onnxruntime-osx-* ]] || [[ "$ARTIFACT_NAME" == onnxruntime-ios-* ]]; then ONNXRUNTIME_NAME=libonnxruntime.${{ env.ONNXRUNTIME_VERSION }}.dylib else echo "Unknown target found : ${{ matrix.artifact_name }}" @@ -342,7 +341,7 @@ jobs: - name: Generate RELEASE_NAME if: env.RELEASE == 'true' run: | - echo "RELEASE_NAME=${{ matrix.artifact_name }}-${{ env.ONNXRUNTIME_VERSION }}" >> $GITHUB_ENV + echo "RELEASE_NAME=${{ matrix.artifact_name }}-${{ env.ONNXRUNTIME_VERSION }}" >> "$GITHUB_ENV" - name: Rearchive artifact if: env.RELEASE == 'true' @@ -364,7 +363,7 @@ jobs: steps: - name: Generate RELEASE_NAME and ONNXRUNTIME_BASENAME run: | - echo "RELEASE_NAME=onnxruntime-ios-xcframework-${{ env.ONNXRUNTIME_VERSION }}" >> $GITHUB_ENV + echo "RELEASE_NAME=onnxruntime-ios-xcframework-${{ env.ONNXRUNTIME_VERSION }}" >> "$GITHUB_ENV" echo "ONNXRUNTIME_BASENAME=libonnxruntime.${{ env.ONNXRUNTIME_VERSION }}.dylib" >> "$GITHUB_ENV" - uses: actions/checkout@v3