Browse Source

Add 'python/.github/workflows/autoci.yml'

天问 4 years ago
parent
commit
492c0e4e14
1 changed files with 48 additions and 0 deletions
  1. 48 0
      python/.github/workflows/autoci.yml

+ 48 - 0
python/.github/workflows/autoci.yml

@@ -0,0 +1,48 @@
+name: auto CI
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+  schedule:
+  - cron: "0 2 * * 1-5"
+
+jobs:
+  build:
+
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v2
+        
+      - name: Set up Python 3.8
+        uses: actions/setup-python@v2
+        with:
+          python-version: 3.8
+
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+
+      - uses: actions/cache@v1
+        if: startsWith(runner.os, 'Linux')
+        with:
+          path: ~/.cache/pip
+          key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
+          restore-keys: |
+            ${{ runner.os }}-pip-
+
+      - name: Update Deny Host
+        run: |
+          pwd
+          python cmd/refresh.py
+
+      - name: Push to built branch
+        uses: Automattic/action-commit-to-branch@master
+        with:
+          branch: 'master'
+          commit_message: 'Update Host'
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}