Skip to content

Commit

Permalink
automatically determine transforms in transforms directory for which …
Browse files Browse the repository at this point in the history
…to generate test workflows

Signed-off-by: David Wood <[email protected]>
  • Loading branch information
daw3rd committed Sep 18, 2024
1 parent a887bf9 commit f9399c1
Show file tree
Hide file tree
Showing 25 changed files with 443 additions and 33 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ LANG_TRANSFORMS=doc_chunk doc_quality lang_id pdf2parquet pii_redactor text_enco


transform-tests:
for i in $(CODE_TRANSFORMS); do \
cat test-transform.template | sed -e "s?@TARGET_TRANSFORM_DIR@?transforms/code/$$i?g" > test-code-$$i.yml; \
done
for i in $(LANG_TRANSFORMS); do \
cat test-transform.template | sed -e "s?@TARGET_TRANSFORM_DIR@?transforms/language/$$i?g" > test-language-$$i.yml; \
done
for i in $(UNIVERSAL_TRANSFORMS); do \
cat test-transform.template | sed -e "s?@TARGET_TRANSFORM_DIR@?transforms/universal/$$i?g" > test-universal-$$i.yml; \
$(MAKE) TRANSFORM_SUBDIR=universal .transform-tests
$(MAKE) TRANSFORM_SUBDIR=language .transform-tests
$(MAKE) TRANSFORM_SUBDIR=code .transform-tests

# Expects
# TRANSFORM_SUBDIR transforms subdirectory (such as universal)
.transform-tests:
@for i in $$(find ../../transforms/$(TRANSFORM_SUBDIR) -depth 1 -type d); do \
dir=$$(basename $$i); \
yml=test-$(TRANSFORM_SUBDIR)-$$dir.yml; \
echo Generating $$yml; \
cat test-transform.template | sed -e "s?@TARGET_TRANSFORM_DIR@?transforms/$${TRANSFORM_SUBDIR}/$$dir?g" > $$yml; \
done



5 changes: 2 additions & 3 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Workflow Management

Here we have the start of a system to automatically generated workflows (currently only for transforms).
Here we have the start of a system to automatically generated github workflows (currently only for transforms).
In general, the design is to use templates and `make` to generate/update the workflows.

```
Expand All @@ -21,7 +21,6 @@ The Makefile is used to (re)generate all workflows a necessary. By design, work

When a new transform is added to the repository,

1. add it to the corresponding macro in the Makefile (in alphabetical order please).
1. Run `make` to create the new test .yml for the transform
1. Run `make` in this directory to create the new test .yml for all transforms found in transforms/{universal,code,language} directories
1. commit and push the change to your branch with the new transform.

2 changes: 1 addition & 1 deletion .github/workflows/test-code-code2parquet.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/code/code2parquet

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-code-code_quality.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/code/code_quality

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-code-header_cleanser.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/code/header_cleanser

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-code-malware.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/code/malware

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-code-proglang_select.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/code/proglang_select

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-code-repo_level_ordering.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/code/repo_level_ordering

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-language-doc_chunk.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/language/doc_chunk

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-language-doc_quality.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/language/doc_quality

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-language-lang_id.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/language/lang_id

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-language-pdf2parquet.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/language/pdf2parquet

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-language-pii_redactor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/language/pii_redactor

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-language-text_encoder.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/language/text_encoder

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-transform.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - @TARGET_TRANSFORM_DIR@

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-universal-doc_id.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/universal/doc_id

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-universal-ededup.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/universal/ededup

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-universal-fdedup.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/universal/fdedup

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-universal-filter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/universal/filter

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-universal-html2parquet.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/universal/html2parquet

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-universal-noop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/universal/noop

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-universal-profiler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/universal/profiler

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-universal-resize.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/universal/resize

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-universal-tokenization.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# DO NOT EDIT THIS: it is generated from test-transform.template, Edit there and run make to change these files
# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files
#
name: Test - transforms/universal/tokenization

Expand Down
Loading

0 comments on commit f9399c1

Please sign in to comment.