Repository navigation
Adding script for DOI updates #271
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
Changes from all commits
3edf987
0e75806
e1bcf46
bcfd69a
9d61e7b
4232625
36e0884
f78aa9f
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 |
|---|---|---|
| @@ -1,116 +1,69 @@ | ||
| name: Lint and Test | ||
|
|
||
| on: | ||
| workflow_call: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| run_unit_tests: | ||
| runs-on: ubuntu-latest | ||
| if: 1 == 0 | ||
| strategy: | ||
| fail-fast: false | ||
|
|
||
| steps: | ||
| - name: Repo checkout | ||
| uses: actions/checkout@main | ||
|
|
||
| - name: Set up Python 3. | ||
| uses: actions/setup-python@main | ||
| with: | ||
| python-version: 3.12 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v6 | ||
|
|
||
| - name: Install dependencies | ||
| id: install_deps | ||
| run: uv sync | ||
|
|
||
| - name: run pytest -rP tests/ | ||
| id: run_pytest | ||
| run: | | ||
| uv run pytest --cov=credit_engine --cov-report=xml -rP tests/ | ||
| continue-on-error: true | ||
|
|
||
| - name: Send to Codecov | ||
| id: send_to_codecov | ||
| uses: codecov/codecov-action@main | ||
| continue-on-error: true | ||
| with: | ||
| files: ./coverage.xml | ||
| fail_ci_if_error: true | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
|
|
||
| - name: outcome failure | ||
| if: steps.run_pytest.outcome != 'success' || steps.send_to_codecov.outcome != 'success' | ||
| run: | | ||
| echo "Python tests: ${{ steps.run_pytest.outcome }}" | ||
| echo "upload coverage: ${{ steps.send_to_codecov.outcome }}" | ||
| exit 1 | ||
|
|
||
| - name: outcome success | ||
| run: | | ||
| echo "Python tests: ${{ steps.run_pytest.outcome }}" | ||
| echo "upload coverage: ${{ steps.send_to_codecov.outcome }}" | ||
| exit 0 | ||
|
|
||
| run_linkml_tasks: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Repo checkout | ||
| uses: actions/checkout@main | ||
|
|
||
| - name: Set up Python 3. | ||
| uses: actions/setup-python@main | ||
| with: | ||
| python-version: 3.12 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v6 | ||
|
|
||
| - name: Install dependencies | ||
| id: install_deps | ||
| run: uv sync | ||
|
|
||
| - name: Lint linkml file | ||
| id: lint_linkml | ||
| run: | | ||
| make lint-no-warn | ||
| continue-on-error: true | ||
|
|
||
| - name: Validate sample data against the schema | ||
| id: test_sample_data | ||
| run: | | ||
| make test-sample-data | ||
| continue-on-error: true | ||
|
|
||
| - name: Validate sample data against JSONschema | ||
| id: test_sample_data_jsonschema | ||
| run: | | ||
| make test-sample-data-jsonschema | ||
| continue-on-error: true | ||
|
|
||
| - name: Test documentation generation | ||
| id: test_docgen | ||
| run: | | ||
| uv sync --group docs | ||
| make gendoc | ||
| continue-on-error: true | ||
|
|
||
| - name: outcome failure | ||
| if: steps.lint_linkml.outcome != 'success' || steps.test_sample_data.outcome != 'success' || steps.test_sample_data_jsonschema.outcome != 'success' || steps.test_docgen.outcome != 'success' | ||
| run: | | ||
| echo "linkml linting: ${{ steps.lint_linkml.outcome }}" | ||
| echo "sample data validation: ${{ steps.test_sample_data.outcome }}" | ||
| echo "sample data JSON Schema validation: ${{ steps.test_sample_data_jsonschema.outcome }}" | ||
| echo "documentation generator: ${{ steps.test_docgen.outcome }}" | ||
| exit 1 | ||
|
|
||
| - name: outcome success | ||
| if: steps.lint_linkml.outcome == 'success' && steps.test_sample_data.outcome == 'success' && steps.test_sample_data_jsonschema.outcome == 'success' && steps.test_docgen.outcome == 'success' | ||
| run: | | ||
| echo All tests passed successfully! | ||
| exit 0 | ||
| jobs: | ||
| run_linkml_tasks: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
|
|
||
| steps: | ||
| - name: Repo checkout | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | ||
|
|
||
| - name: Setup python | ||
| uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 | ||
| with: | ||
| python-version: "3.14" | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e | ||
| with: | ||
| python-version: 3.14 | ||
|
|
||
| - name: Install project | ||
| run: uv sync --frozen --group docs | ||
|
Check warning on line 30 in .github/workflows/run_tests.yaml
|
||
|
|
||
| - name: Lint linkml file | ||
| id: lint_linkml | ||
| run: | | ||
| make lint-no-warn | ||
| continue-on-error: true | ||
|
|
||
| - name: Validate sample data against the schema | ||
| id: test_sample_data | ||
| run: | | ||
| make test-sample-data | ||
| continue-on-error: true | ||
|
|
||
| - name: Validate sample data against JSONschema | ||
| id: test_sample_data_jsonschema | ||
| run: | | ||
| make test-sample-data-jsonschema | ||
| continue-on-error: true | ||
|
|
||
| - name: Test documentation generation | ||
| id: test_docgen | ||
| run: | | ||
| make gendoc | ||
| continue-on-error: true | ||
|
|
||
| - name: outcome failure | ||
| if: steps.lint_linkml.outcome != 'success' || steps.test_sample_data.outcome != 'success' || steps.test_sample_data_jsonschema.outcome != 'success' || steps.test_docgen.outcome != 'success' | ||
| run: | | ||
| echo "linkml linting: ${{ steps.lint_linkml.outcome }}" | ||
| echo "sample data validation: ${{ steps.test_sample_data.outcome }}" | ||
| echo "sample data JSON Schema validation: ${{ steps.test_sample_data_jsonschema.outcome }}" | ||
| echo "documentation generator: ${{ steps.test_docgen.outcome }}" | ||
| exit 1 | ||
|
|
||
| - name: outcome success | ||
| if: steps.lint_linkml.outcome == 'success' && steps.test_sample_data.outcome == 'success' && steps.test_sample_data_jsonschema.outcome == 'success' && steps.test_docgen.outcome == 'success' | ||
| run: | | ||
| echo All tests passed successfully! | ||
| exit 0 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: Update KBase DOI List | ||
|
|
||
| on: | ||
| schedule: | ||
| # Runs weekly on Mondays at 08:00 UTC | ||
| - cron: "0 8 * * 1" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| update-kbase-dois: | ||
| runs-on: ubuntu-latest | ||
| name: Generate and update KBase DOI list | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | ||
| with: | ||
| ref: main | ||
|
|
||
| - name: Setup python | ||
| uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 | ||
| with: | ||
| python-version: "3.14" | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e | ||
| with: | ||
| python-version: 3.14 | ||
|
|
||
| - name: Install project | ||
| run: uv sync --frozen | ||
|
Check warning on line 34 in .github/workflows/update_kbase_dois.yaml
|
||
|
|
||
| - name: Generate KBase DOI list | ||
| run: uv run --frozen scripts/gen_kbase_doi_list.py | ||
|
Check warning on line 37 in .github/workflows/update_kbase_dois.yaml
|
||
|
|
||
| - name: Create Pull Request with updated KBase DOI list | ||
| uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 | ||
| with: | ||
| token: ${{ secrets.GHCR_TOKEN || github.token }} | ||
| add-paths: | | ||
| src/docs/pages/kbase_dois.md | ||
| base: main | ||
| branch: update-kbase-dois | ||
| delete-branch: true | ||
| commit-message: "Update KBase FAIR Narratives DOI list" | ||
| title: "Update KBase FAIR Narratives DOI list" | ||
| body: | | ||
| Automated weekly update of `src/docs/pages/kbase_dois.md` generated by `scripts/gen_kbase_doi_list.py`. | ||
Uh oh!
There was an error while loading. Please reload this page.