From 5145716392406bf49180f8524c94623b325895ad Mon Sep 17 00:00:00 2001 From: vaitkus Date: Mon, 8 Jun 2026 10:37:47 +0300 Subject: [PATCH 1/2] Add the dictionary check GitHub action --- .github/workflows/main.yml | 148 +++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..bb7f7aa --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,148 @@ +# 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: 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: main + + - 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: Check out the coreCIF dictionary + uses: actions/checkout@v6 + with: + repository: COMCIFS/cif_core + path: cif_core + + - 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 + pwd + which julia + + - name: Run dictionary layout checks + run: | + julia -e 'using Pkg; Pkg.status()' + for file in main/*.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 From 94b7e3d4db4a298de98670379af65b5b8f600b2a Mon Sep 17 00:00:00 2001 From: vaitkus Date: Mon, 8 Jun 2026 10:58:54 +0300 Subject: [PATCH 2/2] Disable layout check --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bb7f7aa..a735b77 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,6 +63,8 @@ jobs: layout: name: Layout + # Disable the layout check for now + if: false runs-on: ubuntu-latest needs: syntax