2020-11-10 21:36:42 +08:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-05-15 00:12:10 +08:00
|
|
|
- main
|
2021-01-13 22:13:15 +08:00
|
|
|
- v*-branch
|
2023-09-26 14:30:12 +08:00
|
|
|
pull_request:
|
2020-11-10 21:36:42 +08:00
|
|
|
|
2020-11-12 21:45:07 +08:00
|
|
|
name: imgtool
|
|
|
|
|
2021-12-17 21:35:59 +08:00
|
|
|
concurrency:
|
|
|
|
group: imgtool-${{ github.event.pull_request.number || github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-11-10 21:36:42 +08:00
|
|
|
jobs:
|
2023-09-26 14:30:12 +08:00
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
python-version: ["3.x", "pypy3.9"]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
cache: 'pipenv'
|
|
|
|
cache-dependency-path: |
|
|
|
|
scripts/setup.py
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
pip install --user pipenv
|
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
cd scripts
|
|
|
|
pipenv run pip install pytest -e .
|
|
|
|
pipenv run pytest --junitxml=../junit/pytest-results-${{ matrix.python-version }}.xml
|
|
|
|
- name: Upload test results
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
name: pytest-results-${{ matrix.python-version }}
|
|
|
|
path: |
|
|
|
|
junit/pytest-results-${{ matrix.python-version }}*.xml
|
|
|
|
if-no-files-found: ignore
|
2020-11-10 21:36:42 +08:00
|
|
|
environment:
|
2023-09-26 14:30:12 +08:00
|
|
|
if: ${{ github.event_name == 'push' }}
|
2020-11-10 21:36:42 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-02-12 06:30:55 +08:00
|
|
|
- name: Cache pip
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
key: ${{ runner.os }}-pip
|
2020-11-12 21:45:07 +08:00
|
|
|
- name: Install packages
|
2020-11-10 21:36:42 +08:00
|
|
|
run: |
|
|
|
|
export PATH="$HOME/.local/bin:$PATH"
|
|
|
|
./ci/imgtool_install.sh
|
2020-11-12 21:45:07 +08:00
|
|
|
- name: Publish
|
2020-11-10 21:36:42 +08:00
|
|
|
env:
|
|
|
|
TWINE_TOKEN: ${{ secrets.TWINE_TOKEN }}
|
|
|
|
run: |
|
|
|
|
export PATH="$HOME/.local/bin:$PATH"
|
|
|
|
./ci/imgtool_run.sh
|