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

add files for github actions #31

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
56 changes: 56 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: install-and-test-workflow
on: [push]
jobs:
# install-and-test:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python 3.9
# uses: actions/setup-python@v5
# with:
# python-version: 3.9
# - name: Install dependencies
# run: |
# pip install --upgrade pip
# pip install '.[dev]' --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple
# pip install coverage coveralls
# - name: Test with pytest
# run: |
# python -m coverage run -m pytest -sv
# - name: Submit to coveralls
# continue-on-error: true
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# coveralls --service=github
# build-and-install:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python 3.9
# uses: actions/setup-python@v5
# with:
# python-version: 3.9
# - name: Build the package
# run: |
# pip install --upgrade pip
# pip install build
# python -m build --sdist
# - name: Install the package
# run: |
# pip install dist/*.tar.gz --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple
ruff-linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
args: "check ."
# to enable auto-formatting check, uncomment the following lines below
ruff-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
args: "format . --check"
26 changes: 26 additions & 0 deletions .github/workflows/mkdocs-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy MkDocs Site

on:
push:
branches:
- main # Triggers deployment on push to the main branch
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: mkdocs.yml
REQUIREMENTS: requirements_docs.txt
18 changes: 17 additions & 1 deletion src/nomad_ikz_plugin/movpe/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
from nomad.datamodel.metainfo.workflow import (
Link,
)

# from nomad.datamodel.context import ClientContext, ServerContext
# from nomad.app.v1.models.models import User
# from nomad.files import UploadFiles
# from nomad.app.v1.routers.uploads import get_upload_with_read_access

from nomad.metainfo import (
Quantity,
Reference,
Expand Down Expand Up @@ -1295,8 +1301,18 @@ def normalize(self, archive, logger):

if (
sample.substrate is not None
and sample.substrate.reference is not None
and sample.substrate.reference.m_proxy_value is not None
):
# sub_context = ServerContext(
# get_upload_with_read_access(
# matches["upload_id"][0],
# User(
# is_admin=True,
# user_id=archive.metadata.main_author.user_id,
# ),
# include_others=True,
# )
# ) # Upload(upload_id=matches["upload_id"][0]))
if hasattr(
getattr(sample.substrate.reference, 'substrate'),
'name',
Expand Down
Loading