-
Notifications
You must be signed in to change notification settings - Fork 2
169 lines (147 loc) · 4.85 KB
/
checker-python.yml
File metadata and controls
169 lines (147 loc) · 4.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Checker Python
on:
push:
paths:
- 'src/**/*.py'
- 'data/**/*.py'
- '.github/workflows/checker-python.yml'
- 'requirements*'
- 'setup*'
- 'Taskfile*'
workflow_dispatch:
inputs:
max:
description: 'The maximum proxies to be checked.'
required: true
default: '100'
type: string
workflow_call:
inputs:
max:
description: 'The maximum proxies to be checked.'
required: true
default: '100'
type: string
secrets:
ACCESS_TOKEN:
required: true
schedule:
- cron: '0 */3 * * *' # Every 3 hours
concurrency:
group: python-proxy-checker
cancel-in-progress: false
jobs:
build:
if: contains(github.repository, 'php-proxy-hunter')
runs-on: windows-latest
env:
PIP_CACHE_DIR: '${{ github.workspace }}/project/tmp/pip'
NUITKA_CACHE_DIR: '${{ github.workspace }}/project/tmp/nuitka-cache'
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
YARN_ENABLE_GLOBAL_CACHE: false
YARN_CACHE_FOLDER: '${{ github.workspace }}/tmp/yarn-cache'
PUPPETEER_SKIP_DOWNLOAD: 'true'
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true'
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
YARN_CHECKSUM_BEHAVIOR: update
steps:
- name: Checkout Main Repository
uses: actions/checkout@v6
with:
repository: dimaslanjaka/php-proxy-hunter
ref: master
token: ${{ secrets.ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
lfs: true
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22.x
cache: 'yarn'
cache-dependency-path: 'package.json'
- name: Enable Corepack
run: corepack enable
- name: Update Git Submodules and Install Global Node Tools
run: |
echo "Initializing submodules..."
git submodule update --init --recursive
npm install -g rimraf binary-collections@https://raw.githubusercontent.com/dimaslanjaka/bin/master/releases/bin.tgz
npx rimraf .git/modules
npx submodule-install
- name: Get pip Cache Directory
id: pip-cache
run: echo "pip_cache_dir=$(pip cache dir)" >> $GITHUB_ENV
- name: Cache Dependencies and Outputs
uses: actions/cache@v5
with:
path: |
~/.cache/pip
**/dist/**
**/tmp/**
src/*.sqlite*
src/*.mmdb
**/node_modules/**
.yarn/caches/
.yarn/*.gz
./venv/
${{ env.pip_cache_dir }}
${{ env.NUITKA_CACHE_DIR }}
*.lock
*.txt
package-lock.json
assets/proxies/
vendor/
${{ env.USERPROFILE }}\AppData\Local\Nuitka\Nuitka\Cache
$HOME/AppData/Local/Nuitka/Nuitka/Cache
config/
.cache/
working.json
key: ${{ runner.os }}-python-${{ hashFiles('.husky/hash.txt') }}
restore-keys: |
${{ runner.os }}-python-${{ hashFiles('.husky/hash.txt') }}
${{ runner.os }}-python-
${{ runner.os }}-
- name: Restore Non-cached Files
run: git restore *.txt
- name: Install Required Tools
run: |
npm install -g @go-task/cli
python3 -m ensurepip --upgrade
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install requests
- name: Install Node.js Dependencies
shell: bash
run: task install-nodejs
- name: Install Python Dependencies (if cache missed)
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
run: task install-python
- name: Install Python Minimal Dependencies (if cache missed)
if: steps.cache.outputs.cache-hit != 'true'
shell: cmd
run: .\bin\python-minimal.cmd
- name: Initialize Project Scripts
id: php-github-actions-init
env:
GITHUB_OUTPUT: $GITHUB_OUTPUT
run: python3 github-actions-init.py
- name: Download Required Files
run: python3 src/geoPlugin.py
- name: Cleanup Project
run: python3 cleaner.py
- name: Fetch Proxies
run: python3 proxyFetcher.py
- name: Check Proxies
shell: bash
run: |
MAX_INPUT="${{ inputs.max || github.event.inputs.max || '100' }}"
echo "Checking max $MAX_INPUT proxies"
python3 proxyCheckerReal.py --max="$MAX_INPUT"
- name: Upload Proxies
run: python3 proxyWorking.py