Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-zimerman committed Jan 23, 2024
1 parent f220350 commit 58f44c1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/buildandtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Test
runs-on: ubuntu-latest
needs: [Skip CI]
if: ${{ !env.skip_ci)) }}
if: ${{ env.skip_ci == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -32,7 +32,8 @@ jobs:
job_lint:
name: Lint
runs-on: ubuntu-latest
if: ${{ !contains(git diff --name-only HEAD~ HEAD, $(cat .github/.ci_ignore_files)) }}
needs: [Skip CI]
if: ${{ env.skip_ci == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
Expand All @@ -49,7 +50,8 @@ jobs:
job_lint_sample_new_arch:
name: Lint Sample
runs-on: ubuntu-latest
if: ${{ !contains(git diff --name-only HEAD~ HEAD, $(cat .github/.ci_ignore_files)) }}
needs: [Skip CI]
if: ${{ env.skip_ci == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
Expand All @@ -68,7 +70,8 @@ jobs:
job_check_integrity:
name: Check package integrity
runs-on: ubuntu-latest
if: ${{ !contains(git diff --name-only HEAD~ HEAD, $(cat .github/.ci_ignore_files)) }}
needs: [Skip CI]
if: ${{ env.skip_ci == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
Expand All @@ -87,7 +90,8 @@ jobs:
job_build:
name: Build
runs-on: ubuntu-latest
if: ${{ !contains(git diff --name-only HEAD~ HEAD, $(cat .github/.ci_ignore_files)) }}
needs: [Skip CI]
if: ${{ env.skip_ci == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down Expand Up @@ -130,8 +134,8 @@ jobs:
job_type_check:
name: Type Check Typescript 3.8
runs-on: ubuntu-latest
needs: [job_build]
if: ${{ !contains(git diff --name-only HEAD~ HEAD, $(cat .github/.ci_ignore_files)) }}
needs: [job_build, Skip CI]
if: ${{ env.skip_ci == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down Expand Up @@ -170,7 +174,8 @@ jobs:
job_circular_dep_check:
name: Circular Dependency Check
runs-on: ubuntu-latest
needs: [job_build]
needs: [job_build, Skip CI]
if: ${{ env.skip_ci == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down Expand Up @@ -201,8 +206,8 @@ jobs:
job_bundle:
name: Bundle
runs-on: ubuntu-latest
if: ${{ !contains(git diff --name-only HEAD~ HEAD, $(cat .github/.ci_ignore_files)) }}
needs: [job_test, job_build]
if: ${{ env.skip_ci == 'true' }}
needs: [job_test, job_build, Skip CI]
strategy:
# we want that the matrix keeps running, default is to cancel them if it fails.
fail-fast: false
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/skip-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ jobs:
with:
fetch-depth: 0

- name: Check diff from
- name: Check diff from Pull Request
run: |
skipList=(".github/codeowners")
# Ignores changelog.md, readme.md,...
fileChangesArray=($(git diff --name-only origin/${{ github.base_ref }}..origin/${{ github.head_ref }} | grep -v '\.md$'))
echo ${fileChangesArray}
for item in "${fileChangesArray[@]}"
do
if [[ ! " ${my_array[@]} " =~ " ${item} " ]]; then
echo "{skip_ci}=false >> $GITHUB_ENV"
if [[ ! " ${skipList[@]} " =~ " ${item} " ]]; then
#found an item that doesn't belong to the skip list.
exit 0
fi
done
Expand Down

0 comments on commit 58f44c1

Please sign in to comment.