-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add icalendar 5.0 support and test against 5.0 and 6.x #160
base: master
Are you sure you want to change the base?
Changes from all commits
a5f61cd
d930010
7b7f43f
1a394d6
2aa3170
a8baa3c
2c1ff49
53cd92d
6dd957b
58c94c9
36fbf2d
7972192
e02456c
ca32b60
8fc1268
249e22b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# To validate this file on changes before committing, see https://api.codecov.io/validate | ||
|
||
codecov: | ||
notify: | ||
after_n_builds: 2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,30 +5,34 @@ on: | |
tags: | ||
- '*' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
if: github.repository == 'jazzband/icalevents' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: "Checkout repository with all history for all branches and tags" | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
- name: "Set up latest Python 3 version" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
python-version: "3.x" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry==2.0.1 | ||
- name: "Install poetry" | ||
uses: abatilo/actions-poetry@v3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not a huge fan of extra deps in the build steps There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mhm, yeah, I understand. But it's more readable in my opinion and when you look at the code of the action, it doesn't do a lot different then the code before. Main difference is the encapsulation of poetry from the global python environment inside the docker container by using pipx instead of pip. If you feel better about it, I can revert the changes. But I would keep the separation in two build steps (install poetry itself - install the project dependencies). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets do that, than we can merge and publish |
||
with: | ||
poetry-version: "2.0.1" | ||
|
||
- name: Build package | ||
- name: "Build package" | ||
run: poetry build | ||
|
||
- name: Upload packages to Jazzband | ||
- name: "Upload packages to Jazzband" | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Run pytest | ||
|
||
on: | ||
|
@@ -9,26 +6,45 @@ on: | |
pull_request: | ||
branches: [master] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# When changing this matrix, you have to change the "after_n_builds" parameter | ||
# in the .github/codecov.yml file. It must match the number of builds being | ||
# started considering the matrix. See the following links for more information: | ||
# https://docs.codecov.com/docs/notifications#preventing-notifications-until-after-n-builds | ||
# https://docs.codecov.com/docs/pull-request-comments#after_n_builds | ||
icalendar-version: | ||
- "5" # means (>=5.0.0,<6.0.0) | ||
- "6" # means (>=6.0.0,<7.0.0) | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.9 | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Set up Python 3.9" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
- name: Install dependencies | ||
python-version: "3.9" | ||
|
||
- name: "Install poetry" | ||
uses: abatilo/actions-poetry@v3 | ||
with: | ||
poetry-version: "2.0.1" | ||
|
||
- name: "Install icalendar ${{ matrix.icalendar-version }} and other dependencies" | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry==2.0.1 | ||
poetry install | ||
- name: Test with pytest | ||
poetry add icalendar~=${{ matrix.icalendar-version }}.0 --no-interaction | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. awesome! :-) |
||
- name: "Test with pytest" | ||
run: | | ||
poetry run coverage run test.py | ||
poetry run coverage xml | ||
- name: 'Upload coverage to Codecov' | ||
|
||
- name: "Upload coverage to Codecov" | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
fail_ci_if_error: false |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's recommended by the
setup-python
action to set it toread
. According to the GitHub documentation, the default would benone
, which means that the whole action has no read permission to the content of the repository. I know it works without it for now, but well, if they they say it may not work, I introduced it here to be sure.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to know. thanks for pointing this out