Skip to content
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

Rhfogh xml yaml #957

Merged
merged 7 commits into from
Jul 8, 2024
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
86 changes: 43 additions & 43 deletions .github/workflows/coverage_report.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
%YAML 1.2
---

name: Coverage Report

on: # yamllint disable-line rule:truthy
on:
pull_request:
types: [opened, reopened, synchronize]
paths:
Expand All @@ -16,45 +17,44 @@ jobs:

steps:

# yamllint disable-line rule:indentation
- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
# yamllint disable rule:line-length
run: |
sudo apt-get update && sudo apt-get install -y libsasl2-dev libldap2-dev libssl-dev
python -m pip install --upgrade pip
python -m pip install poetry --user
python -m poetry install --extras=tango
# yamllint enable rule:line-length

- name: Run and write pytest
# yamllint disable rule:line-length
run: |
set -o pipefail
poetry run pytest --cov=mxcubecore --junitxml=pytest.xml --cov-report=term-missing:skip-covered | tee pytest-coverage.txt
# yamllint enable rule:line-length

- name: Pytest coverage comment
id: coverage-comment
uses: MishaKav/[email protected]
with:
repo-token: ${{ secrets.CI_TOKEN }}
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
report-only-changed-files: true

- name: Check the output coverage
run: |
echo "Coverage Percantage - ${{ steps.coverage-comment.outputs.coverage }}"
echo "Coverage Warnings - ${{ steps.coverage-comment.outputs.warnings }}"
echo "Coverage Errors - ${{ steps.coverage-comment.outputs.errors }}"
echo "Coverage Failures - ${{ steps.coverage-comment.outputs.failures }}"
echo "Coverage Skipped - ${{ steps.coverage-comment.outputs.skipped }}"
echo "Coverage Tests - ${{ steps.coverage-comment.outputs.tests }}"
echo "Coverage Time - ${{ steps.coverage-comment.outputs.time }}"
- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
# yamllint disable rule:line-length
run: |
sudo apt-get update && sudo apt-get install -y libsasl2-dev libldap2-dev libssl-dev
python -m pip install --upgrade pip
python -m pip install poetry --user
python -m poetry install --extras=tango
# yamllint enable rule:line-length

- name: Run and write pytest
# yamllint disable rule:line-length
run: |
set -o pipefail
poetry run pytest --cov=mxcubecore --junitxml=pytest.xml --cov-report=term-missing:skip-covered | tee pytest-coverage.txt
# yamllint enable rule:line-length

- name: Pytest coverage comment
id: coverage-comment
uses: MishaKav/[email protected]
with:
repo-token: ${{ secrets.CI_TOKEN }}
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
report-only-changed-files: true

- name: Check the output coverage
run: |
echo "Coverage Percantage - ${{ steps.coverage-comment.outputs.coverage }}"
echo "Coverage Warnings - ${{ steps.coverage-comment.outputs.warnings }}"
echo "Coverage Errors - ${{ steps.coverage-comment.outputs.errors }}"
echo "Coverage Failures - ${{ steps.coverage-comment.outputs.failures }}"
echo "Coverage Skipped - ${{ steps.coverage-comment.outputs.skipped }}"
echo "Coverage Tests - ${{ steps.coverage-comment.outputs.tests }}"
echo "Coverage Time - ${{ steps.coverage-comment.outputs.time }}"
170 changes: 85 additions & 85 deletions .github/workflows/create-tag.yml
Original file line number Diff line number Diff line change
@@ -1,101 +1,101 @@
%YAML 1.2
---

name: Create/Update Tag
on: # yamllint disable-line rule:truthy
on:
push:
branches:
- develop
jobs:
create-version-tag:
runs-on: ubuntu-latest
steps:
# yamllint disable-line rule:indentation
- uses: actions/checkout@v3
with:
token: ${{ secrets.CI_TOKEN }}
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: actions/checkout@v3
with:
token: ${{ secrets.CI_TOKEN }}
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Update version
id: update-version
run: |
- name: Update version
id: update-version
run: |
pip install --upgrade pip
pip install poetry
poetry version minor
git config --global user.email "[email protected]"
git config --global user.name "Marcus Oskarsson"
git add -A
git commit -m "[skip ci] Bumped minor version"
git push -f
poetry build
- name: Publish package to PyPI
id: publish-pacakge
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI }}
poetry publish
- name: Read package version
id: set-tag
# yamllint disable rule:line-length
run: |
pip install --upgrade pip
pip install poetry
poetry version minor
git config --global user.email "[email protected]"
git config --global user.name "Marcus Oskarsson"
git add -A
git commit -m "[skip ci] Bumped minor version"
git push -f
poetry build
- name: Publish package to PyPI
id: publish-pacakge
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI }}
poetry publish
- name: Read package version
id: set-tag
# yamllint disable rule:line-length
run: |
pip install --upgrade pip
pip install toml
echo ::set-output name=tag_name::v$(python -c 'import toml; print(toml.load("./pyproject.toml")["tool"]["poetry"]["version"])')
# yamllint enable rule:line-length
pip install toml
echo ::set-output name=tag_name::v$(python -c 'import toml; print(toml.load("./pyproject.toml")["tool"]["poetry"]["version"])')
# yamllint enable rule:line-length

- name: Check tag exists
id: check-tag-exists
uses: actions/github-script@v6
env:
TAG: ${{ steps.set-tag.outputs.tag_name }}
with:
github-token: ${{ github.token }}
script: |
// https://github.com/mukunku/tag-exists-action
var exists = 'false';
try {
const getRefResponse = await github.rest.git.getRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}"
});
- name: Check tag exists
id: check-tag-exists
uses: actions/github-script@v6
env:
TAG: ${{ steps.set-tag.outputs.tag_name }}
with:
github-token: ${{ github.token }}
script: |
// https://github.com/mukunku/tag-exists-action
var exists = 'false';
try {
const getRefResponse = await github.rest.git.getRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}"
});

if (getRefResponse.status === 200) {
console.log("Tag was found");
exists = 'true';
}
} catch(error) {
console.log("Tag was not found");
}
core.setOutput('exists', exists);
if (getRefResponse.status === 200) {
console.log("Tag was found");
exists = 'true';
}
} catch(error) {
console.log("Tag was not found");
}
core.setOutput('exists', exists);

- name: Update tag
uses: actions/github-script@v6
if: steps.check-tag-exists.outputs.exists == 'true'
env:
TAG: ${{ steps.set-tag.outputs.tag_name }}
with:
github-token: ${{ github.token }}
script: |
github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}",
sha: context.sha
})
- name: Update tag
uses: actions/github-script@v6
if: steps.check-tag-exists.outputs.exists == 'true'
env:
TAG: ${{ steps.set-tag.outputs.tag_name }}
with:
github-token: ${{ github.token }}
script: |
github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}",
sha: context.sha
})

- name: Create tag
uses: actions/github-script@v6
if: steps.check-tag-exists.outputs.exists != 'true'
env:
TAG: ${{ steps.set-tag.outputs.tag_name }}
with:
github-token: ${{ github.token }}
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}",
sha: context.sha
})
- name: Create tag
uses: actions/github-script@v6
if: steps.check-tag-exists.outputs.exists != 'true'
env:
TAG: ${{ steps.set-tag.outputs.tag_name }}
with:
github-token: ${{ github.token }}
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}",
sha: context.sha
})
7 changes: 4 additions & 3 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%YAML 1.2
---


Expand All @@ -6,9 +7,9 @@ name: "Pages"
concurrency:
group: "pages"

on: # yamllint disable-line rule:truthy
push:
pull_request:
on:
push: null
pull_request: null

jobs:

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
%YAML 1.2
---

name: Linting & Code Quality

on: # yamllint disable-line rule:truthy
on:
pull_request:
types: [opened, reopened, synchronize]

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
%YAML 1.2
---

name: Pytest
on: # yamllint disable-line rule:truthy
on:
pull_request:
types: [opened, reopened, synchronize]
paths:
Expand Down
24 changes: 24 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,27 @@ rules:
# Match line length to the one set by `black` the Python formatter
line-length:
max: 88

# octal values must start with 0o, numbers may not start with e.g. 01
# It is simpler, and costs nothing, to disallow values like `010`
# except as quoted strings
octal-values:
forbid-implicit-octal: true

# This bans implicit nulls, nulls must be explicit.
empty-values: enable

# With these settings, and `%YAML 1.2` in the file header, we have :
#
# Booleans: true, false
# None: null, Null, NULL
# not-a-number: .NaN, .NAN, .nan
# Infinity: .Inf, .INF, .inf
# Strings: On, ON, Off, OFF, YES, Yes, NO, No
# Disallowed if not quoted: True, TRUE, False, FALSE
#
# Setting `truthy: disabled` would allow the disabled values, as Booleans
#
# If desired, you could ban unquoted infinity and not-a-number by
# float-values: forbind-int: true
# float-values: forbind-nan: true
1 change: 1 addition & 0 deletions conda-environment-dev.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%YAML 1.2
---

name: mxcubecore
Expand Down
2 changes: 1 addition & 1 deletion mxcubecore/HardwareRepository.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
yaml = YAML(typ="safe", pure=True)
# The following are not needed for load, but define the default style.
yaml.default_flow_style = False
yaml.indent(mapping=4, sequence=4, offset=2)
yaml.indent(mapping=2, sequence=4, offset=2)


__copyright__ = """ Copyright © 2010 - 2020 by MXCuBE Collaboration """
Expand Down
1 change: 1 addition & 0 deletions mxcubecore/configuration/alba_xaloc13/beamline_config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%YAML 1.2
---

# FIRST DRAFT of ALAB xaloc13 configuration. TO BE EDITED
Expand Down
1 change: 1 addition & 0 deletions mxcubecore/configuration/embl_hh_p14/beamline_config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%YAML 1.2
---

# FIRST DRAFT of EMBL P14 configuration. TO BE EDITED
Expand Down
1 change: 1 addition & 0 deletions mxcubecore/configuration/esrf_id30a2/gphl-setup.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%YAML 1.2
---

_initialise_class:
Expand Down
Loading