blob: 03b191e1685dff079e141327592c612db4bfce64 [file] [log] [blame]
Fabio Utzigc06694e2020-11-10 10:36:42 -03001on:
2 push:
3 branches:
David Brownfe0bfcf2021-05-14 10:12:10 -06004 - main
Fabio Utzigc1b29832021-01-13 11:13:15 -03005 - v*-branch
Denis Mingulov12026042023-09-26 09:30:12 +03006 pull_request:
Fabio Utzigc06694e2020-11-10 10:36:42 -03007
Fabio Utzig0be390e2020-11-12 10:45:07 -03008name: imgtool
9
Gustavo Henrique Niheie5718552021-12-17 10:35:59 -030010concurrency:
11 group: imgtool-${{ github.event.pull_request.number || github.ref }}
12 cancel-in-progress: true
13
Fabio Utzigc06694e2020-11-10 10:36:42 -030014jobs:
Denis Mingulov12026042023-09-26 09:30:12 +030015 test:
16 runs-on: ubuntu-latest
17 strategy:
18 matrix:
19 python-version: ["3.x", "pypy3.9"]
20 steps:
21 - uses: actions/checkout@v4
22 - name: Set up Python ${{ matrix.python-version }}
23 uses: actions/setup-python@v4
24 with:
25 python-version: ${{ matrix.python-version }}
26 cache: 'pipenv'
27 cache-dependency-path: |
28 scripts/setup.py
29 - name: Install dependencies
30 run: |
31 pip install --user pipenv
32 - name: Run tests
33 run: |
34 cd scripts
35 pipenv run pip install pytest -e .
36 pipenv run pytest --junitxml=../junit/pytest-results-${{ matrix.python-version }}.xml
37 - name: Upload test results
38 uses: actions/upload-artifact@v3
39 if: always()
40 with:
41 name: pytest-results-${{ matrix.python-version }}
42 path: |
43 junit/pytest-results-${{ matrix.python-version }}*.xml
44 if-no-files-found: ignore
Fabio Utzigc06694e2020-11-10 10:36:42 -030045 environment:
Denis Mingulov12026042023-09-26 09:30:12 +030046 if: ${{ github.event_name == 'push' }}
Fabio Utzigc06694e2020-11-10 10:36:42 -030047 runs-on: ubuntu-latest
48 steps:
49 - uses: actions/checkout@v2
50 with:
51 fetch-depth: 0
Fabio Utzig7bf51792021-02-11 19:30:55 -030052 - name: Cache pip
53 uses: actions/cache@v1
54 with:
55 path: ~/.cache/pip
56 key: ${{ runner.os }}-pip
Fabio Utzig0be390e2020-11-12 10:45:07 -030057 - name: Install packages
Fabio Utzigc06694e2020-11-10 10:36:42 -030058 run: |
59 export PATH="$HOME/.local/bin:$PATH"
60 ./ci/imgtool_install.sh
Fabio Utzig0be390e2020-11-12 10:45:07 -030061 - name: Publish
Fabio Utzigc06694e2020-11-10 10:36:42 -030062 env:
63 TWINE_TOKEN: ${{ secrets.TWINE_TOKEN }}
64 run: |
65 export PATH="$HOME/.local/bin:$PATH"
66 ./ci/imgtool_run.sh