Skip to content

Commit 1aae14e

Browse files
committed
feat [init]
1 parent 8b0507c commit 1aae14e

28 files changed

+52673
-9
lines changed

.github/classroom/autograding.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"externalFile": "handleResult.js",
3+
"outputFile": "output.txt"
4+
}

.github/classroom/checkresult.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// TODO 判断文件是否存在
2+
3+
const jsonResult = require('../result/check_result.json');
4+
5+
function judge(outputFile) {
6+
let points = {};
7+
jsonResult.exercises.forEach(({ name, result }) => {
8+
if (result) {
9+
points[name] = [1,1]
10+
} else {
11+
points[name] = [0,1]
12+
}
13+
})
14+
return points;
15+
}
16+
17+
module.exports.judge = judge;

.github/classroom/handleResult.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
async function run({points, availablePoints}, { log, github, axios }) {
2+
// let github = require("@actions/github")
3+
// let request = require("request");
4+
// console.log(request);
5+
// console.log(github);
6+
log("github actor: ", github.actor)
7+
// log(github.actor);
8+
// log(axios.get);
9+
10+
// const get = (url,params)=>{
11+
// params = params || {};
12+
// return new Promise((resolve,reject)=>{
13+
// // axiso 自带 get 和 post 方法
14+
// axios.get(url,{
15+
// params,
16+
// }).then(res=>{
17+
// resolve(res.data)
18+
// }).catch(error=>{
19+
// resolve(error);
20+
// })
21+
// })
22+
// }
23+
24+
// 检测文件是否已经生成
25+
// 如果生成则通知或上传到指定的服务器
26+
let url = 'https://ilink.szlanyou.com/ilinkGW/ilink-open/api/msg/sendMsgByRobotAccid?app_key=ROBOTER&app_secret=7bf4c891aff711ecb5c400505688a6d9&from_id=app_devops_robot&to_type=0&to_id=prod_kunj&msg_class=1&msg_title=通知&msg_content=GitHub执行成功';
27+
let res = await axios.post(url, {
28+
msg_title:"通知",
29+
msg_content:"GitHub执行成功"
30+
});
31+
log(res.data);
32+
33+
}
34+
35+
module.exports.run = run;

.github/workflows/rust.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,25 @@ env:
1212
jobs:
1313
build:
1414
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
node-version: [16.x]
19+
1520
steps:
1621
- uses: actions/checkout@v3
1722
- name: Build
1823
run: cargo build --verbose
1924
- name: Run tests
20-
run: cargo test --verbose
25+
run: cargo test --test check --verbose
26+
- name: upload result
27+
uses: actions/upload-artifact@v1
28+
with:
29+
name: check_result
30+
path: ${{ github.workspace }}/.github/result/check_result.json
31+
- name: Use Node.js ${{ matrix.node-version }}
32+
uses: actions/setup-node@v1
33+
with:
34+
node-version: ${{ matrix.node-version }}
35+
- run: npm install
36+
- run: npm start

.gitignore

+115
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,118 @@ rust-project.json
1111
!.vscode/extensions.json
1212
*.iml
1313
*.o
14+
15+
*.swp
16+
target/
17+
**/*.rs.bk
18+
.DS_Store
19+
*.pdb
20+
exercises/clippy/Cargo.toml
21+
exercises/clippy/Cargo.lock
22+
rust-project.json
23+
.idea
24+
.vscode/*
25+
!.vscode/extensions.json
26+
*.iml
27+
*.o
28+
info.toml
29+
.github/result/check_result.json
30+
31+
# Ignore test runner output
32+
__tests__/runner/*
33+
34+
# Ignore test execution output
35+
*.class
36+
37+
# Ignore node_modules by default (not for release)
38+
node_modules
39+
40+
# =========================
41+
# Node.js-Specific Ignores
42+
# =========================
43+
44+
# Logs
45+
logs
46+
*.log
47+
npm-debug.log*
48+
yarn-debug.log*
49+
yarn-error.log*
50+
51+
# node-waf configuration
52+
.lock-wscript
53+
54+
# Dependency directories
55+
jspm_packages/
56+
57+
# Typescript v1 declaration files
58+
typings/
59+
60+
# Optional npm cache directory
61+
.npm
62+
63+
# Optional eslint cache
64+
.eslintcache
65+
66+
# Optional REPL history
67+
.node_repl_history
68+
69+
# Output of 'npm pack'
70+
*.tgz
71+
72+
# Yarn Integrity file
73+
.yarn-integrity
74+
75+
# dotenv environment variables file
76+
.env
77+
.env*
78+
79+
# =========================
80+
# Operating System Files
81+
# =========================
82+
83+
# OSX
84+
# =========================
85+
86+
.DS_Store
87+
.AppleDouble
88+
.LSOverride
89+
90+
# Thumbnails
91+
._*
92+
93+
# Files that might appear on external disk
94+
.Spotlight-V100
95+
.Trashes
96+
97+
# Directories potentially created on remote AFP share
98+
.AppleDB
99+
.AppleDesktop
100+
Network Trash Folder
101+
Temporary Items
102+
.apdisk
103+
104+
# Windows
105+
# =========================
106+
107+
# Windows image file caches
108+
Thumbs.db
109+
ehthumbs.db
110+
111+
# Folder config file
112+
Desktop.ini
113+
114+
# Recycle Bin used on file shares
115+
$RECYCLE.BIN/
116+
117+
# Windows Installer files
118+
*.cab
119+
*.msi
120+
*.msm
121+
*.msp
122+
123+
# Windows shortcuts
124+
*.lnk
125+
126+
# Snippets
127+
NOTES.md
128+

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
12.7.0

0 commit comments

Comments
 (0)