Skip to content

Commit

Permalink
Improve test action
Browse files Browse the repository at this point in the history
  • Loading branch information
XFY9326 committed Feb 23, 2024
1 parent ef35ceb commit 847c611
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 66 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/python_compatibility_test.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/python_coverage_test.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Test

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
compatibility_test:
name: Compatibility test
runs-on: ubuntu-20.04
strategy:
matrix:
python: [ "3.6", "3.7", "3.8", "3.9" ]

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest ./tests/
coverage_test:
name: Coverage test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
pip install pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest --cov=src ./tests/
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: XFY9326/PyNdef
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![!python-versions](https://img.shields.io/badge/Python-3.6%20%7C%203.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue)
[![codecov](https://codecov.io/gh/XFY9326/PyNdef/graph/badge.svg?token=QVJNICD0GA)](https://codecov.io/gh/XFY9326/PyNdef)
[![Python compatibility test](https://github.com/XFY9326/PyNdef/actions/workflows/python_compatibility_test.yml/badge.svg?branch=master)](https://github.com/XFY9326/PyNdef/actions/workflows/python_compatibility_test.yml)
[![Test](https://github.com/XFY9326/PyNdef/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/XFY9326/PyNdef/actions/workflows/test.yml)

Pure Python library for creating and parsing NDEF messages.
All codes in this repository are referred to AOSP NDEF implementation.
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ maintainers = [
]
description = "Pure Python library for creating and parsing NDEF messages."
readme = "README.md"
license = { file = "LICENSE" }
keywords = ["nfc", "ndef", "ndef-library"]
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand Down

0 comments on commit 847c611

Please sign in to comment.