forked from COMCIFS/cif_core
-
Notifications
You must be signed in to change notification settings - Fork 1
152 lines (126 loc) · 4.08 KB
/
Copy pathmain.yml
File metadata and controls
152 lines (126 loc) · 4.08 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# Check the syntax, semantics and layout of DDLm dictionaries
name: CIF Syntax and Style Check
# Controls when the action will run. Triggers the workflow on push or pull
# request events but only for the main branch
on:
push:
branches:
- main
paths-ignore:
- '.github/**'
pull_request:
branches:
- main
paths-ignore:
- '.github/**'
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
syntax:
name: Syntax
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out the target repository
uses: actions/checkout@v6
# Check syntax of all CIF files
- name: Check CIF syntax
uses: COMCIFS/cif_syntax_check_action@master
id: cif_syntax_check
semantics:
name: Semantics
runs-on: ubuntu-latest
needs: syntax
steps:
- name: Check out the target repository
uses: actions/checkout@v6
- name: Check out the DDLm reference dictionary
uses: actions/checkout@v6
with:
repository: COMCIFS/DDLm
path: cif-dictionaries/DDLm
- name: Check out enumeration templates
uses: actions/checkout@v6
with:
repository: COMCIFS/Enumeration_Templates
path: cif-dictionaries/Enumeration_Templates
- name: Check out attribute templates
uses: actions/checkout@v6
with:
repository: COMCIFS/Attribute_Templates
path: cif-dictionaries/Attribute_Templates
- name: Run dictionary validity checks
uses: COMCIFS/dictionary_check_action@main
id: ddlm_check
layout:
name: Layout
runs-on: ubuntu-latest
needs: syntax
env:
JULIA_VERSION: '1.10'
JULIA_DEP_FILE: 'julia_cif_tools/Project.toml'
steps:
- name: Install Julia
uses: julia-actions/setup-julia@v3
with:
version: ${{ env.JULIA_VERSION }}
- name: Check out Julia tools
uses: actions/checkout@v6
with:
repository: jamesrhester/julia_cif_tools
path: julia_cif_tools
- name: Get the cache
uses: actions/cache@v5
id: cache
with:
path: ~/.julia
key: ${{ runner.os }}-julia-${{ env.JULIA_VERSION }}-${{ hashFiles(env.JULIA_DEP_FILE) }}
- name: Install Julia packages
if: steps.cache.outputs.cache-hit != 'true'
run: |
julia -e 'using Pkg, TOML; map(Pkg.add, collect(keys(TOML.parsefile("${{ env.JULIA_DEP_FILE }}")["deps"]))); Pkg.instantiate()'
- name: Check out the target repository
uses: actions/checkout@v6
with:
path: cif_core
- name: Check out the DDLm reference dictionary
uses: actions/checkout@v6
with:
repository: COMCIFS/DDLm
path: DDLm
- name: Check out enumeration templates
uses: actions/checkout@v6
with:
repository: COMCIFS/Enumeration_Templates
path: enum
- name: Check out attribute templates
uses: actions/checkout@v6
with:
repository: COMCIFS/Attribute_Templates
path: templ
- name: Move template files to the expected location
run: |
mv enum/templ_enum.cif cif_core/templ_enum.cif
mv templ/templ_attr.cif cif_core/templ_attr.cif
- name: Run diagnostics
run: |
ls -a
echo "pwd:"
pwd
echo "Julia location:"
which julia
echo "cif_core contents"
ls cif_core
- name: Run dictionary layout checks
run: |
julia -e 'using Pkg; Pkg.instantiate(); Pkg.status()'
for file in cif_core/*.dic
do
echo "Checking $file"
julia -O0 ./julia_cif_tools/linter.jl -i $PWD/cif_core $file $PWD/DDLm/ddl.dic
if [ $? != 0 ]
then
exit 1 ;
fi
done