forked from Bruuuuuuce/PKUAutoSubmit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Bruuuuuuce#39 from ErnestDong/main
增加 github actions
- Loading branch information
Showing
3 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Python Package using Conda | ||
|
||
on: | ||
schedule: | ||
- cron: "0 */4 * * *" | ||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 5 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Add conda to system path | ||
run: | | ||
# $CONDA is an environment variable pointing to the root of the miniconda directory | ||
echo $CONDA/bin >> $GITHUB_PATH | ||
- name: Install dependencies | ||
run: | | ||
pip3 install selenium==3.8.0 | ||
- name: generate config.ini | ||
run: | ||
python3 actions.py -u ${{ secrets.STUDENTNUM }} -p ${{ secrets.PASSWD }} | ||
- name: main | ||
run: | ||
python3 main.py |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from configparser import ConfigParser | ||
import argparse | ||
|
||
cfg = ConfigParser() | ||
cfg.read("config.sample.ini") | ||
|
||
parser = argparse.ArgumentParser(description="generate config.ini") | ||
|
||
parser.add_argument("-u", type=str, help="学号") | ||
parser.add_argument("-p", type=str, help="密码") | ||
args = parser.parse_args() | ||
cfg.set("login", "username", args.u) | ||
cfg.set("login", "password", args.p) | ||
cfg.write(open("config.ini", "w")) |