Skip to content

Commit 8ef7da4

Browse files
committed
Check project files are properly generated in CI workflow
1 parent 19d303d commit 8ef7da4

5 files changed

Lines changed: 28 additions & 7 deletions

File tree

.drom

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/workflow.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ jobs:
6868

6969
# use fields.opam-repo = "git+https://" to add an 'extra' opam repository
7070

71-
7271
# Use fields.github-workflow-before-build to add something here
7372
- run: git submodule init
7473

@@ -118,6 +117,12 @@ jobs:
118117
if: matrix.os == 'windows-latest'
119118

120119
# Use fields.github-workflow-before-build to add something here
120+
- name: Check project files
121+
run: |
122+
opam pin --yes "git+https://github.com/OCamlPro/drom.git#v0.9.3"
123+
make check-project
124+
if: ${{ matrix.ocaml-compiler == '4.14.2' && matrix.os == 'ubuntu-latest' && matrix.skip_test == 'true' }}
125+
121126
- uses: actions/setup-node@v4
122127
with:
123128
node-version: '>=16'

.github/workflows/workflow.yml.drom-tpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ jobs:
7272
sudo apt-get update
7373

7474
![fi]
75-
7675
# Use fields.github-workflow-before-build to add something here
7776
!(github-workflow-before-opam)
7877
- run: opam pin add . -y --no-action

Makefile.header

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ opam-cross: opam-cross-osx opam-cross-windows
6565
opam-cross-osx opam-cross-windows: opam-cross-%:
6666
rm -rf opam/$*/
6767
opam exec -- drom dep --cross $*
68-
rm -f opam/$*/*-js-*.opam
69-
rm -f opam/$*/vscode-debug*.opam
70-
rm -f opam/$*/*-vscode-*.opam
68+
rm -f opam/$*/*-js-*.opam \
69+
opam/$*/vscode-debug*.opam \
70+
opam/$*/*-vscode-*.opam
7171
sed -i opam/$*/*.opam \
7272
-e '/"goblint-cil-$*" *{/ d' \
7373
-e '/"ANSITerminal-$*" *{/ d' \
@@ -80,6 +80,17 @@ project:
8080
opam exec -- drom project $(DROM_PROJECT_ARGS)
8181
$(MAKE) opam-fix opam-cross
8282

83+
# Warning: erases non-skipped user-modified files
84+
.PHONY: check-project
85+
check-project:
86+
$(MAKE) project DROM_PROJECT_ARGS=--force
87+
git restore --staged .
88+
git update-index --refresh
89+
# git diff-index --quiet HEAD -- # <- takes untracked files into account.
90+
git ls-files --modified
91+
92+
# ---
93+
8394
# emacs-lsp:
8495
emacs/lsp-superbol-customs.el: $(LSP_MODE_SRCDIR) package.json
8596
emacs --batch > "$@" \

drom.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ github-workflow-before-opam = """
124124
"""
125125

126126
github-workflow-before-build = """
127+
- name: Check project files
128+
run: |
129+
opam pin --yes \"git+https://github.com/OCamlPro/drom.git#v0.9.3\"
130+
make check-project
131+
if: ${{ matrix.ocaml-compiler == '4.14.2' && matrix.os == 'ubuntu-latest' && matrix.skip_test == 'true' }}
132+
127133
- uses: actions/setup-node@v4
128134
with:
129135
node-version: '>=16'

0 commit comments

Comments
 (0)