summaryrefslogtreecommitdiffstats
path: root/.github/workflows/unittest.yml
blob: aadc7b86c0573cf3ce625b27c52569a8075c7b89 (plain) (blame)
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
name: Unittest

on: 
  pull_request:
    types:
      - opened
      - synchronize
  push:
    branches:
      - 'main'

jobs:
  build:
    name: Build unittest
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Set up Python
      uses: actions/setup-python@v4
      with:
        python-version: "3.x"
        cache: 'pip'
    - name: Install requirements
      run: pip install -r requirements.txt
    - name: Run tests
      run: python -m etc.unittest
    - name: Save PR number
      env:
        PR_NUMBER: ${{ github.event.number }}
      run: |
        mkdir -p ./pr
        echo $PR_NUMBER > ./pr/pr_number
    - uses: actions/upload-artifact@v4
      with:
        name: pr_number
        path: pr/