Skip to content

Commit

Permalink
add ci test
Browse files Browse the repository at this point in the history
  • Loading branch information
renbaoshuo committed Oct 7, 2024
1 parent a792187 commit fca2098
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test

on:
push:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
environment: 052106112

steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'

- name: Test
run: go test
env:
JWCH_USERNAME: ${{ secrets.SCHOOL_ID }}
JWCH_PASSWORD: ${{ secrets.PASSWORD }}
7 changes: 4 additions & 3 deletions jwch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ package jwch

import (
"fmt"
"os"
"testing"

"github.com/west2-online/jwch/utils"
)

const (
username = "" // 学号
password = "" // 密码
var (
username = os.Getenv("JWCH_USERNAME") // 学号
password = os.Getenv("JWCH_PASSWORD") // 密码
localfile = "logindata.txt"
)

Expand Down

0 comments on commit fca2098

Please sign in to comment.