forked from shadowcopyrz/etkg
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (97 loc) · 3.47 KB
/
test.yml
File metadata and controls
98 lines (97 loc) · 3.47 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
name: Test the project and update the test-date
on:
schedule:
- cron: '0 */12 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
mail:
description: 'Choose the mail provider'
required: true
type: choice
options:
- 1secmail
- guerrillamail
- developermail
- mailticking
- fakemail
- inboxes
- incognitomail
- emailfake
default: emailfake
jobs:
Test:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repo'
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: 'Generate key and update the test time'
run: |
ACCOUNT=0
KEY=1
SMALL_BUSINESS_KEY=1
VPN=0
EMAIL_API="${{ github.event.inputs.mail }}"
if [ -z "$EMAIL_API" ]; then
EMAIL_API="emailfake"
fi
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git clone --depth 1 https://github.com/shadowcopyrz/etkg.git
cd etkg
# Setup env
sudo apt update
sudo apt install -y python3-pip python3-venv
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
echo "Test results:" >> $GITHUB_STEP_SUMMARY
if [[ ${ACCOUNT} != 0 ]]
then
for ((attempt=1;attempt<=${ACCOUNT};++attempt))
do
python3 main.py --auto-detect-browser --account --email-api ${EMAIL_API} --skip-update-check --no-logo --disable-progress-bar --disable-logging
done
echo -e "\nAccounts generated:" >> $GITHUB_STEP_SUMMARY
cat ./*ACCOUNTS.txt >> $GITHUB_STEP_SUMMARY
fi
if [[ ${KEY} != 0 ]]
then
for ((attempt=1;attempt<=${KEY};++attempt))
do
python3 main.py --auto-detect-browser --key --email-api ${EMAIL_API} --skip-update-check --no-logo --disable-progress-bar --disable-logging
done
fi
if [[ ${SMALL_BUSINESS_KEY} != 0 ]]
then
for ((attempt=1;attempt<=${SMALL_BUSINESS_KEY};++attempt))
do
python3 main.py --auto-detect-browser --small-business-key --email-api ${EMAIL_API} --skip-update-check --no-logo --disable-progress-bar --disable-logging
done
fi
if [[ ${VPN} != 0 ]]
then
for ((attempt=1;attempt<=${VPN};++attempt))
do
python3 main.py --auto-detect-browser --vpn-codes --email-api ${EMAIL_API} --skip-update-check --no-logo --disable-progress-bar --disable-logging
done
fi
if [[ ${KEY} != 0 || ${SMALL_BUSINESS_KEY} != 0 || ${VPN} != 0 ]]
then
echo -e "\nKeys generated:" >> $GITHUB_STEP_SUMMARY
cat ./*KEYS.txt >> $GITHUB_STEP_SUMMARY
fi
echo
cd ${{ github.workspace }}
sed -i 's/\(last_test-\)[0-9]\{2\}.[0-9]\{2\}.[0-9]\{4\}_[0-9]\{2\}:[0-9]\{2\}_UTC+3/\1'"$(date -u --date='3 hours' +"%d.%m.%Y_%H:%M_UTC+3")"'/' README.md
sudo rm -r etkg
git pull
git commit -m "Update test time" -a
- name: Push changes to the repo
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PAT }}
branch: ${{ github.ref }}