Skip to content

companys

companys #2105

Workflow file for this run

name: companys
on:
push:
pull_request:
branches: ["main"]
schedule:
## 每10分钟触发一次
# 分 时 日 月 周
- cron: "*/20 * * * *"
repository_dispatch:
types:
- companys
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
env:
GITHUB_TOKEN: "${{ secrets.GTOKEN }}"
GITHUB_TOKEN1: "${{ secrets.GTOKEN }}"
- name: Clone Code
shell: bash
continue-on-error: true
run: |
git clone https://oauth2:${{ secrets.GTOKEN }}@github.com/parserpp/icpRes.git ../icp
- name: Install dependencies
shell: bash
continue-on-error: true
run: |
cd ../icp
echo "查看文件树"
tree
echo "开始安装依赖"
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run Code for test
shell: bash
continue-on-error: true
run: |
cd ../icp
python main.py
- name: see the result
shell: bash
continue-on-error: true
run: |
cd ../icp
git status
echo "--------------------------查看成功列表结果-----------------------------"
awk 'END {print NR}' res/success_companys.txt
echo "--------------------------查看失败列表结果-----------------------------"
awk 'END {print NR}' res/failed_companys.txt
echo "--------------------------查看结果-----------------------------"
awk 'END {print NR}' res/companys_res.txt
- name: commit_server
shell: bash
continue-on-error: true
run: |
cd ../icp
git config --global user.name "GithubAction"
git config --global user.email "[email protected]"
if [ -z "$(git status --porcelain)" ]
then
echo "============================nothing to update.==============================="
else
git add .
git commit -am "GitHubAction: triggle by commit ${{ github.sha }}. created by ${{ github.workflow }}." -a
git push
fi