Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/actions/setup-uv/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ description: Install Python, uv, and sync dependencies with caching
inputs:
dependency-group:
description: 'Dependency group to sync (e.g., dev, test, docs)'
required: true
required: false
default: ''

runs:
using: composite
Expand All @@ -30,4 +31,9 @@ runs:

- name: Sync dependencies
shell: bash
run: uv sync --locked --extra ${{ inputs.dependency-group }} # extras are defined in [project.optional-dependencies]
run: |
cmd="uv sync --locked"
if [ -n "${{ inputs.dependency-group }}" ]; then
cmd="$cmd --extra ${{ inputs.dependency-group }}"
fi
eval "$cmd" # extras are defined in [project.optional-dependencies]
27 changes: 16 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ jobs:
run: uv run genbadge coverage -i coverage.xml -o coverage.svg
continue-on-error: true

- name: Run small analysis without publishing
run: uv run sw-metadata-bot run-analysis --config-file assets/example_list_repo.json


- name: Commit coverage badge
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: |
Expand All @@ -111,9 +107,20 @@ jobs:
git push
continue-on-error: true

test-small-analysis:
name: Minimal integration test (small analysis)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- name: Setup uv environment
uses: ./.github/actions/setup-uv

- name: Run small analysis without publishing
run: uv run sw-metadata-bot run-analysis --config-file assets/example_list_repo.json

test-gitlab-integration:
name: Test (GitLab integration)
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
env:
GITLAB_API_TOKEN: ${{ secrets.GITLAB_API_TOKEN }}
Expand All @@ -132,11 +139,9 @@ jobs:
exit 0

- name: Verify GitLab token before integration tests
if: ${{ env.GITLAB_API_TOKEN != '' }}
run: uv run sw-metadata-bot verify-tokens --gitlab

- name: Run GitLab integration tests
if: ${{ env.GITLAB_API_TOKEN != '' }}
run: uv run pytest --run-integration-gitlab -m "integration_gitlab" tests/test_gitlab_integration.py


Expand Down Expand Up @@ -206,7 +211,7 @@ jobs:
publish-pypi:
name: Publish to PyPI
if: github.event_name == 'release'
needs: [lint, test]
needs: [lint, test, test-zenodo-connection, test-gitlab-integration, test-small-analysis]
runs-on: ubuntu-latest
permissions:
id-token: write
Expand All @@ -228,7 +233,7 @@ jobs:
publish-zenodo:
# name: Publish to Zenodo
if: github.event_name == 'release'
needs: [lint, test, test-zenodo-connection]
needs: [lint, test, test-zenodo-connection, test-gitlab-integration, test-small-analysis]
runs-on: ubuntu-latest
container:
image: registry.gitlab.com/escape-ossr/eossr:v2.2.0
Expand All @@ -242,12 +247,12 @@ jobs:
- name: Change publicationDate in .zenodo.json to current date (fix eossr)
run: |
TODAY=$(date +%Y-%m-%d)
sed -i "s/\"publicationDate\": \".*\"/\"publicationDate\": \"$TODAY\"/" .zenodo.json
sed -i "s/\"publication_date\": \".*\"/\"publication_date\": \"$TODAY\"/" .zenodo.json
sed -i "s/\"dateModified\": \".*\"/\"dateModified\": \"$TODAY\"/" codemeta.json
- name: Upload and Publish to Zenodo via eossr
run: |
eossr-upload-repository \
--token "${{ secrets.ZENODO_ACCESS_TOKEN }}" \
--input-dir . \
--archive-name sw-metadata-bot-{{github.event.release.tag_name}}.zip \
--archive-name "sw-metadata-bot-${{ github.event.release.tag_name }}.zip" \
--record_id "${{ secrets.ZENODO_DEPOSITION_ID }}"
Loading