This repository has been archived by the owner on Oct 25, 2024. It is now read-only.
[Optimization] Text-generation support qwen #1860
Workflow file for this run
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
name: Copyright Check | |
on: | |
pull_request: | |
branches: [main] | |
paths: | |
- intel_extension_for_transformers/** | |
- setup.py | |
- .github/workflows/format_scan.yml | |
workflow_dispatch: | |
# If there is a new commit, the previous jobs will be canceled | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
CODE_SCAN_LOG_PATH: "${{ github.workspace }}/log" | |
CONTAINER_NAME: "codeScan" | |
jobs: | |
format-scan: | |
runs-on: itrex-node-spell | |
strategy: | |
matrix: | |
job_name: ["copyright"] | |
fail-fast: false | |
steps: | |
- name: Docker Clean Up | |
run: | | |
docker ps -a | |
if [[ $(docker ps -a | grep -i '${{ env.CONTAINER_NAME }}-${{ runner.name }}'$) ]]; then | |
docker start ${{ env.CONTAINER_NAME }}-${{ runner.name }} | |
echo "remove left files through container ..." | |
docker exec ${{ env.CONTAINER_NAME }}-${{ runner.name }} bash -c "ls -a /intel-extension-for-transformers && rm -fr /intel-extension-for-transformers/* && rm -fr /intel-extension-for-transformers/.* || true" | |
fi | |
- name: Checkout out Repo | |
uses: actions/checkout@v3 | |
- name: CopyRight check | |
run: | | |
source ${{ github.workspace }}/.github/workflows/script/change_color.sh | |
set -e | |
mkdir -p ${{ env.CODE_SCAN_LOG_PATH }} | |
supported_extensions=(py, sh, yaml) | |
git fetch | |
git --no-pager diff --name-only remotes/origin/${{ github.base_ref }} ${{ github.workspace }}/intel_extension_for_transformers> ${{ env.CODE_SCAN_LOG_PATH }}/diff.log | |
files=$(cat ${{ env.CODE_SCAN_LOG_PATH }}/diff.log | awk '!a[$0]++') | |
$LIGHT_PURPLE && echo " ----------------- checking ... --------------------------" && $RESET | |
if [[ -f ${{ env.CODE_SCAN_LOG_PATH }}/copyright_issue_summary.log ]]; then | |
rm -f ${{ env.CODE_SCAN_LOG_PATH }}/copyright_issue_summary.log | |
fi | |
for file in ${files} | |
do | |
if [[ "${supported_extensions[@]}" =~ "${file##*.}" ]]; then | |
if [ $(grep -E -c "Copyright \\(c\\) ([0-9]{4})(-[0-9]{4})? Intel Corporation" ${file}) = 0 ]; then | |
echo ${file} >> ${{ env.CODE_SCAN_LOG_PATH }}/copyright_issue_summary.log | |
$BOLD_YELLOW && echo " ----------------- Current log file output start --------------------------" | |
cat ${{ env.CODE_SCAN_LOG_PATH }}/copyright_issue_summary.log | |
$BOLD_YELLOW && echo " ----------------- Current log file output end --------------------------" && $RESET | |
$BOLD_RED && echo "CopyRight has something wrong! Please click on the artifact button to download and view the error log!" && $RESET | |
fi | |
else | |
$LIGHT_PURPLE && echo "Skipping ${file}" && $RESET | |
fi | |
done | |
if [[ -f ${{ env.CODE_SCAN_LOG_PATH }}/copyright_issue_summary.log ]]; then | |
$BOLD_YELLOW && echo " ----------------- Current log file output start --------------------------" | |
cat ${{ env.CODE_SCAN_LOG_PATH }}/copyright_issue_summary.log | |
$BOLD_YELLOW && echo " ----------------- Current log file output end --------------------------" && $RESET | |
$BOLD_RED && echo "CopyRight has something wrong! Please click on the artifact button to download and view the error log!" && $RESET && exit 1 | |
fi | |
- name: Publish pipeline artifact | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.job_name }} | |
path: ${{ env.CODE_SCAN_LOG_PATH }}.* |