|
1 | | -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node |
2 | | -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions |
| 1 | +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
| 2 | +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python |
3 | 3 |
|
4 | 4 | name: test |
5 | 5 |
|
6 | 6 | on: |
7 | 7 | push: |
8 | 8 | branches: [ release, test ] |
| 9 | + pull_request: |
| 10 | + branches: [ main ] |
9 | 11 |
|
10 | 12 | jobs: |
11 | 13 | build: |
12 | 14 |
|
13 | 15 | runs-on: ${{ matrix.os }} |
14 | 16 | environment: build |
15 | | - if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'skip linux')" |
| 17 | + if: ${{ !contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'skip linux') }} |
16 | 18 |
|
17 | 19 | strategy: |
18 | 20 | matrix: |
19 | 21 | os: [ubuntu-latest] |
| 22 | + python-version: ["3.8", "3.9", "3.10", "3.11"] |
20 | 23 |
|
21 | 24 | steps: |
22 | | - - uses: actions/checkout@v2 |
23 | | - |
24 | | - # script: |
25 | | - - run: cp sample.env .env |
26 | | - - run: pip --version |
27 | | - - run: pip install -r requirements.txt |
28 | | - - run: bin/test |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + - name: Set up Python ${{ matrix.python-version }} |
| 27 | + uses: actions/setup-python@v4 |
| 28 | + with: |
| 29 | + python-version: ${{ matrix.python-version }} |
| 30 | + - name: Install dependencies |
| 31 | + run: | |
| 32 | + python -m pip install --upgrade pip |
| 33 | + pip install -r requirements.txt |
| 34 | + - name: Copy environment file |
| 35 | + run: cp sample.env .env |
| 36 | + - name: Run tests |
| 37 | + run: bin/test |
29 | 38 |
|
0 commit comments