-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
125 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: ShellSpec Test PR Review | ||
|
||
on: | ||
pull_request_review: | ||
paths: | ||
- "addons/*/scripts-ut-spec/**" | ||
types: [submitted] | ||
|
||
|
||
jobs: | ||
shellspec-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
all_but_latest: true | ||
access_token: ${{ env.GITHUB_TOKEN }} | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: shellspec test | ||
run: | | ||
make scripts-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: ShellSpec Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
tags-ignore: | ||
- '**' | ||
|
||
env: | ||
BASE_BRANCH: origin/main | ||
|
||
jobs: | ||
shellspec-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
if: ${{ github.ref_name != 'main' }} | ||
uses: styfle/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
all_but_latest: true | ||
access_token: ${{ env.GITHUB_TOKEN }} | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get base commit id | ||
id: get_base_commit_id | ||
env: | ||
REF_NAME: ${{ github.ref_name }} | ||
run: | | ||
BASE_COMMITID=`bash .github/utils/utils.sh --type 1 \ | ||
--branch-name "${{ env.REF_NAME }}" \ | ||
--base-branch "${{ env.BASE_BRANCH }}"` | ||
echo "BASE_COMMITID:$BASE_COMMITID" | ||
echo BASE_COMMITID=$BASE_COMMITID >> $GITHUB_ENV | ||
- name: Get file path | ||
id: get_file_path | ||
run: | | ||
FILE_PATH=`git diff --name-only HEAD ${{ env.BASE_COMMITID }}` | ||
echo "FILE_PATH: $FILE_PATH" | ||
SHELL_FILE_PATH="" | ||
for filePath in $(echo "$FILE_PATH"); do | ||
if [[ "${filePath}" == *"addons/"*"/scripts-ut-spec/"* && -f "${filePath}" ]]; then | ||
SHELL_FILE_PATH="${SHELL_FILE_PATH} ${filePath}" | ||
fi | ||
done | ||
echo shell_file_path=$SHELL_FILE_PATH >> $GITHUB_OUTPUT | ||
- name: Install kcov | ||
if: ${{ steps.get_file_path.outputs.shell_file_path || github.ref_name == 'main' }} | ||
run: sudo apt-get install -y bash kcov | ||
|
||
- name: shellspec test | ||
if: ${{ steps.get_file_path.outputs.shell_file_path || github.ref_name == 'main' }} | ||
run: | | ||
make scripts-test-kcov | ||
- name: Upload coverage | ||
if: ${{ steps.get_file_path.outputs.shell_file_path || github.ref_name == 'main' }} | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
run: | | ||
bash <(curl -s https://codecov.io/bash) -s coverage | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
INCLUDE_PATH="" | ||
for dir in $(find addons -maxdepth 2 -type d -name "scripts-ut-spec"); do | ||
if [ -z "$INCLUDE_PATH" ]; then | ||
INCLUDE_PATH=$dir | ||
else | ||
INCLUDE_PATH=${INCLUDE_PATH},$dir | ||
fi | ||
done | ||
|
||
echo "${INCLUDE_PATH}" |