From ffa5f9db252312722062593faa9e894592efde7a Mon Sep 17 00:00:00 2001 From: Sam Arbid Date: Thu, 8 Feb 2024 15:01:13 +0100 Subject: [PATCH 1/2] Add PyPI Publish and CI workflows --- .github/workflows/pypi-publish.yaml | 39 ++++++++++++++++++++++++ .github/workflows/tests.yaml | 46 +++++++++++++++++++++++++++++ MANIFEST.in | 1 + requirements.txt | 19 ------------ 4 files changed, 86 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/pypi-publish.yaml create mode 100644 .github/workflows/tests.yaml delete mode 100644 requirements.txt diff --git a/.github/workflows/pypi-publish.yaml b/.github/workflows/pypi-publish.yaml new file mode 100644 index 0000000..2f3c684 --- /dev/null +++ b/.github/workflows/pypi-publish.yaml @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2022-2024 KTH Royal Institute of Technology. +# +# invenio-subjects-cessda is free software, you can redistribute it and/or +# modify it under the terms of the MIT License; see LICENSE file details. + +name: PyPI Publish + +on: + push: + tags: + - v* + workflow_dispatch: + inputs: + reason: + description: 'Reason' + required: false + default: 'Manual trigger' +jobs: + pypi-publish: + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/invenio-subjects-cessda + permissions: + id-token: write + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install dependencies + run: | + pip install twine + - name: Run package build + run: | + python setup.py sdist + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..4060821 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2022-2024 KTH Royal Institute of Technology. +# +# invenio-subjects-cessda is free software, you can redistribute it and/or +# modify it under the terms of the MIT License; see LICENSE file details. + +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - master + workflow_dispatch: + inputs: + reason: + description: 'Reason' + required: false + default: 'Manual trigger' + +jobs: + Tests: + runs-on: ubuntu-20.04 + strategy: + matrix: + python-version: [3.9] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Generate dependencies + run: | + pip install -e ".[tests]" + pip freeze + + - name: Run tests + run: | + ./run-tests.sh \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index fe6685f..c9b1038 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,6 +6,7 @@ include license include .pylintrc include Makefile include .editorconfig +recursive-include .github *.yaml recursive-include invenio_subjects_cessda *.csv recursive-include invenio_subjects_cessda *.py recursive-include invenio_subjects_cessda *.yaml diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index fc0aec6..0000000 --- a/requirements.txt +++ /dev/null @@ -1,19 +0,0 @@ -aiohttp==3.9.3 -aiosignal==1.3.1 -async-timeout==4.0.3 -attrs==23.2.0 -black==24.1.1 -certifi==2023.11.17 -charset-normalizer==3.3.2 -click==8.1.7 -frozenlist==1.4.1 -idna==3.6 -multidict==6.0.4 -mypy-extensions==1.0.0 -pathspec==0.12.1 -platformdirs==4.1.0 -requests==2.31.0 -tomli==2.0.1 -typing_extensions==4.9.0 -urllib3==2.1.0 -yarl==1.9.4 From 3d0e0a165cde1fcfd67cb55e742d2dea3eac138b Mon Sep 17 00:00:00 2001 From: Sam Arbid Date: Thu, 8 Feb 2024 15:03:12 +0100 Subject: [PATCH 2/2] Add tests badge to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ddb6002..2a63365 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # invenio-subjects-cessda +![Tests](https://github.com/Samk13/invenio-subjects-cessda/actions/workflows/tests.yml/badge.svg) + ## Overview [CESSDA](https://www.cessda.eu/About) stands for Consortium of European Social Science Data Archives and ERIC stands for European Research Infrastructure Consortium.