-
Notifications
You must be signed in to change notification settings - Fork 10
97 lines (89 loc) · 2.62 KB
/
pytest_asdf.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: pytest asdf
on:
push:
pull_request:
# Run every Monday at 6am UTC
schedule:
- cron: '0 6 * * 1'
# execute commands with conda aware shell by default:
defaults:
run:
shell: bash -l {0}
jobs:
pytest_asdf:
strategy:
matrix:
asdf_version:
- "2.15"
name: pytest asdf
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: CagtayFabry/pydeps2env@main
with:
file: 'pyproject.toml'
channels: 'conda-forge defaults'
extras: 'test'
setup_requires: 'include'
- name: Setup Conda Environment
uses: mamba-org/setup-micromamba@v1.9.0
with:
environment-file: ./environment.yml
environment-name: weldx
init-shell: >-
bash
powershell
cache-environment: true
create-args: >-
python=3.10
pip
- name: activate env
run: micromamba activate weldx
- name: pip install weldx-dev and asdf-matrix-version
run: |
python -m pip install -e . asdf~=${{ matrix.asdf_version }}
- name: run asdf schema pytest
run: |
pytest --asdf-tests --ignore=weldx/tests/ --no-cov weldx/schemas/
- name: check manifest diff
if: always()
run: |
cd ./devtools/scripts/
python ./update_manifest.py
- name: git diff
if: always()
run: |
git diff --color --exit-code
validate_manifest:
name: validate weldx manifest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-0
restore-keys: |
${{ runner.os }}-pip-
- name: pip installs
run: |
pip install asdf>=2.15
- uses: jannekem/run-python-script-action@v1
with:
script: |
from pathlib import Path
import asdf
import yaml
schema = asdf.schema.load_schema(
"asdf://asdf-format.org/core/schemas/extension_manifest-1.0.0"
)
for f in Path("./weldx/manifests/").glob("*.yaml"):
manifest = yaml.safe_load(open(f).read())
asdf.schema.validate(manifest, schema=schema)