Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
huachaohuang committed Feb 25, 2022
2 parents a9380b5 + c039ea2 commit 07bf78b
Show file tree
Hide file tree
Showing 218 changed files with 11,521 additions and 7,616 deletions.
2 changes: 0 additions & 2 deletions .cargo/audit.toml

This file was deleted.

1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
34 changes: 0 additions & 34 deletions .github/actions/cargo-cache/action.yaml

This file was deleted.

117 changes: 117 additions & 0 deletions .github/actions/skip/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Copyright 2021 The Engula Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: "Set Skip Env Var"
description: "Action to check whether we should skip CI jobs"
inputs:
paths-ignore:
description: >-
Output skip=true when and only when all of the changed files located in one of the path,
the paths is shell-style pattern.
required: false
default: >-
"*.md"
"*.svg"
paths:
description: >-
Output skip=true when and only when none of the changed files located in one of the path,
the paths is shell-style pattern.
required: false
default: ''
outputs:
skip:
description: "whether we should skip CI jobs"
value: "${{ steps.check.outputs.skip }}"

runs:
using: "composite"
steps:
- name: Check Changed Files And Set Env Var
id: check
shell: bash
run: |
echo '::set-output name=skip::false'
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
exit 0
fi
BASE_SHA=$(jq -r '.pull_request.base.sha' $GITHUB_EVENT_PATH)
echo "Base sha is $BASE_SHA, head sha is $GITHUB_SHA"
git fetch --no-tags --progress --recurse-submodules --depth=1 origin ${BASE_SHA}:origin/${BASE_SHA}
BASE_SHA=origin/${BASE_SHA}
echo "Base sha is $BASE_SHA, head sha is $GITHUB_SHA"
if ! files=$(git --no-pager diff --name-only ${GITHUB_SHA} ${BASE_SHA}); then
exit 1
fi
echo "Paths Ignore pattern:"
for pattern in $(echo '${{ inputs.paths-ignore }}'); do
echo $pattern
done
echo "Paths pattern:"
for pattern in $(echo '${{ inputs.paths }}'); do
echo $pattern
done
echo "Changed files:"
for file in ${files}; do
echo $file
done
echo "Checking paths-ignore..."
ALL_IGNORE=1
for file in ${files}; do
matched=0
for pattern in $(echo '${{ inputs.paths-ignore }}'); do
pattern=$(echo "$pattern" | sed 's/"//g')
if eval "[[ '$file' == $pattern ]]"; then
matched=1
break
fi
done
if [[ "$matched" == "0" ]]; then
echo "$file doesn't match pattern $(echo '${{ inputs.paths-ignore }}'), stop checking"
ALL_IGNORE=0
break
fi
done
echo "Checking paths..."
NONE_MATCH=1
for file in ${files}; do
matched=0
for pattern in $(echo '${{ inputs.paths }}'); do
pattern=$(echo "$pattern" | sed 's/"//g')
if eval "[[ '$file' == $pattern ]]"; then
matched=1
break
fi
done
if [[ "$matched" == "1" ]]; then
echo "$file match pattern $(echo '${{ inputs.paths }}'), stop checking"
NONE_MATCH=0
break
fi
done
echo "ALL_IGNORE: $ALL_IGNORE, NONE_MATCH: $NONE_MATCH"
if [[ "$ALL_IGNORE" == "1" && "$NONE_MATCH" == "1" ]]; then
echo "Set skip to true because all changed files are in paths-ignore and all changed files are not in paths."
echo '::set-output name=skip::true'
exit 0
fi
51 changes: 0 additions & 51 deletions .github/workflows/audit-security.yml

This file was deleted.

127 changes: 0 additions & 127 deletions .github/workflows/check-code.yml

This file was deleted.

60 changes: 0 additions & 60 deletions .github/workflows/check-dependency.yml

This file was deleted.

Loading

0 comments on commit 07bf78b

Please sign in to comment.