From 2a7e386859b0cfd99edfd1b6900cdd1f821850fb Mon Sep 17 00:00:00 2001 From: liaou3 Date: Fri, 5 Apr 2024 21:47:59 +0800 Subject: [PATCH] Add workflow to test market_time.py --- .github/workflows/test_market_time.yaml | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/test_market_time.yaml diff --git a/.github/workflows/test_market_time.yaml b/.github/workflows/test_market_time.yaml new file mode 100644 index 0000000..618dab4 --- /dev/null +++ b/.github/workflows/test_market_time.yaml @@ -0,0 +1,33 @@ +name: Run Tests on PR with changes to market_time.py + +on: + pull_request: + paths: + - 'MarketTime/market_time.py' + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Copy MarketTime/ folder to tests/ directory + run: | + cp -r MarketTime/ tests/ + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt # 如果有必要的話,根據您的專案設置來安裝相關的依賴 + + - name: Run tests + run: | + python -m unittest tests/test_market_time.py