|
| 1 | +# GitLab CI/CD Configuration for quickchpl |
| 2 | +# Property-Based Testing Framework for Chapel |
| 3 | + |
| 4 | +image: chapel/chapel:2.6.0 |
| 5 | + |
| 6 | +stages: |
| 7 | + - build |
| 8 | + - test |
| 9 | + - docs |
| 10 | + - publish |
| 11 | + |
| 12 | +variables: |
| 13 | + QUICKCHPL_NUM_TESTS: "100" |
| 14 | + QUICKCHPL_VERBOSE: "false" |
| 15 | + |
| 16 | +# Cache Mason dependencies |
| 17 | +cache: |
| 18 | + key: mason-cache |
| 19 | + paths: |
| 20 | + - ~/.mason |
| 21 | + |
| 22 | +# ============================================ |
| 23 | +# Build Stage |
| 24 | +# ============================================ |
| 25 | + |
| 26 | +build: |
| 27 | + stage: build |
| 28 | + script: |
| 29 | + - chpl --version |
| 30 | + - cd src |
| 31 | + - chpl --library chapelcheck.chpl Generators.chpl Combinators.chpl Properties.chpl Shrinkers.chpl Reporters.chpl Patterns.chpl |
| 32 | + artifacts: |
| 33 | + paths: |
| 34 | + - src/*.a |
| 35 | + expire_in: 1 day |
| 36 | + |
| 37 | +# ============================================ |
| 38 | +# Test Stage |
| 39 | +# ============================================ |
| 40 | + |
| 41 | +test:unit:generators: |
| 42 | + stage: test |
| 43 | + needs: ["build"] |
| 44 | + script: |
| 45 | + - echo "Running Generator Tests..." |
| 46 | + - chpl tests/unit/GeneratorTests.chpl src/*.chpl -o /tmp/generator_tests |
| 47 | + - /tmp/generator_tests |
| 48 | + |
| 49 | +test:unit:shrinkers: |
| 50 | + stage: test |
| 51 | + needs: ["build"] |
| 52 | + script: |
| 53 | + - echo "Running Shrinker Tests..." |
| 54 | + - chpl tests/unit/ShrinkerTests.chpl src/*.chpl -o /tmp/shrinker_tests |
| 55 | + - /tmp/shrinker_tests |
| 56 | + |
| 57 | +test:unit:properties: |
| 58 | + stage: test |
| 59 | + needs: ["build"] |
| 60 | + script: |
| 61 | + - echo "Running Property Tests..." |
| 62 | + - chpl tests/unit/PropertyTests.chpl src/*.chpl -o /tmp/property_tests |
| 63 | + - /tmp/property_tests |
| 64 | + |
| 65 | +test:examples: |
| 66 | + stage: test |
| 67 | + needs: ["build"] |
| 68 | + script: |
| 69 | + - echo "Running Getting Started Example..." |
| 70 | + - chpl examples/GettingStarted.chpl src/*.chpl -o /tmp/getting_started |
| 71 | + - /tmp/getting_started |
| 72 | + - echo "Running Algebraic Properties Example..." |
| 73 | + - chpl examples/AlgebraicProperties.chpl src/*.chpl -o /tmp/algebraic |
| 74 | + - /tmp/algebraic |
| 75 | + - echo "Running Custom Generators Example..." |
| 76 | + - chpl examples/CustomGenerators.chpl src/*.chpl -o /tmp/custom_gen |
| 77 | + - /tmp/custom_gen |
| 78 | + |
| 79 | +test:self: |
| 80 | + stage: test |
| 81 | + needs: ["build"] |
| 82 | + script: |
| 83 | + - echo "Running quickchpl self-tests..." |
| 84 | + - chpl tests/properties/SelfTests.chpl src/*.chpl -o /tmp/self_tests |
| 85 | + - /tmp/self_tests --numTests=$QUICKCHPL_NUM_TESTS |
| 86 | + |
| 87 | +# Matrix testing for Chapel versions |
| 88 | +.test:matrix: |
| 89 | + stage: test |
| 90 | + needs: ["build"] |
| 91 | + script: |
| 92 | + - chpl --version |
| 93 | + - chpl tests/unit/GeneratorTests.chpl src/*.chpl -o /tmp/test |
| 94 | + - /tmp/test |
| 95 | + |
| 96 | +test:chapel-2.6.0: |
| 97 | + extends: .test:matrix |
| 98 | + image: chapel/chapel:2.6.0 |
| 99 | + |
| 100 | +test:chapel-2.7.0: |
| 101 | + extends: .test:matrix |
| 102 | + image: chapel/chapel:2.7.0 |
| 103 | + |
| 104 | +# ============================================ |
| 105 | +# Documentation Stage |
| 106 | +# ============================================ |
| 107 | + |
| 108 | +docs:chpldoc: |
| 109 | + stage: docs |
| 110 | + script: |
| 111 | + - mkdir -p docs/api |
| 112 | + - cd src |
| 113 | + - for file in *.chpl; do |
| 114 | + echo "Generating docs for $file..."; |
| 115 | + chpldoc "$file" --output-dir ../docs/api || echo "Warning: chpldoc failed for $file"; |
| 116 | + done |
| 117 | + artifacts: |
| 118 | + paths: |
| 119 | + - docs/api/ |
| 120 | + expire_in: 1 week |
| 121 | + |
| 122 | +# ============================================ |
| 123 | +# GitLab Pages - Documentation Hosting |
| 124 | +# ============================================ |
| 125 | + |
| 126 | +pages: |
| 127 | + stage: publish |
| 128 | + needs: ["docs:chpldoc"] |
| 129 | + script: |
| 130 | + - mkdir -p public |
| 131 | + - cp -r docs/api/* public/ || echo "No API docs to copy" |
| 132 | + - | |
| 133 | + cat > public/index.html << 'HTMLEOF' |
| 134 | + <!DOCTYPE html> |
| 135 | + <html lang="en"> |
| 136 | + <head> |
| 137 | + <meta charset="UTF-8"> |
| 138 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 139 | + <title>quickchpl API Documentation</title> |
| 140 | + <style> |
| 141 | + :root { --bg: #1a1a2e; --fg: #eee; --accent: #7b68ee; --code-bg: #16213e; } |
| 142 | + * { box-sizing: border-box; margin: 0; padding: 0; } |
| 143 | + body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; |
| 144 | + background: var(--bg); color: var(--fg); line-height: 1.6; padding: 2rem; } |
| 145 | + .container { max-width: 960px; margin: 0 auto; } |
| 146 | + h1 { color: var(--accent); margin-bottom: 1rem; font-size: 2.5rem; } |
| 147 | + h2 { color: var(--accent); margin-top: 2rem; margin-bottom: 0.5rem; } |
| 148 | + p { margin-bottom: 1rem; } |
| 149 | + a { color: var(--accent); text-decoration: none; } |
| 150 | + a:hover { text-decoration: underline; } |
| 151 | + .badge { display: inline-block; background: var(--accent); color: white; |
| 152 | + padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.75rem; margin: 0.25rem; } |
| 153 | + code { background: var(--code-bg); padding: 0.125rem 0.25rem; border-radius: 2px; } |
| 154 | + pre { background: var(--code-bg); padding: 1rem; border-radius: 4px; |
| 155 | + overflow-x: auto; margin: 1rem 0; } |
| 156 | + .modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); |
| 157 | + gap: 1rem; margin: 2rem 0; } |
| 158 | + .module { background: var(--code-bg); padding: 1rem; border-radius: 8px; |
| 159 | + border: 1px solid var(--accent); } |
| 160 | + .module h3 { color: var(--accent); margin-bottom: 0.5rem; } |
| 161 | + </style> |
| 162 | + </head> |
| 163 | + <body> |
| 164 | + <div class="container"> |
| 165 | + <h1>quickchpl</h1> |
| 166 | + <p>Property-Based Testing Framework for Chapel</p> |
| 167 | + <div> |
| 168 | + <span class="badge">Chapel 2.6+</span> |
| 169 | + <span class="badge">MIT License</span> |
| 170 | + <span class="badge">v1.0.0</span> |
| 171 | + </div> |
| 172 | +
|
| 173 | + <h2>Modules</h2> |
| 174 | + <div class="modules"> |
| 175 | + <div class="module"> |
| 176 | + <h3>Generators</h3> |
| 177 | + <p>Random value generators for testing</p> |
| 178 | + <a href="Generators.html">Documentation</a> |
| 179 | + </div> |
| 180 | + <div class="module"> |
| 181 | + <h3>Properties</h3> |
| 182 | + <p>Property definition and execution</p> |
| 183 | + <a href="Properties.html">Documentation</a> |
| 184 | + </div> |
| 185 | + <div class="module"> |
| 186 | + <h3>Shrinkers</h3> |
| 187 | + <p>Counterexample minimization</p> |
| 188 | + <a href="Shrinkers.html">Documentation</a> |
| 189 | + </div> |
| 190 | + <div class="module"> |
| 191 | + <h3>Reporters</h3> |
| 192 | + <p>Test result formatting</p> |
| 193 | + <a href="Reporters.html">Documentation</a> |
| 194 | + </div> |
| 195 | + <div class="module"> |
| 196 | + <h3>Combinators</h3> |
| 197 | + <p>Generator composition utilities</p> |
| 198 | + <a href="Combinators.html">Documentation</a> |
| 199 | + </div> |
| 200 | + <div class="module"> |
| 201 | + <h3>Patterns</h3> |
| 202 | + <p>Common property patterns</p> |
| 203 | + <a href="Patterns.html">Documentation</a> |
| 204 | + </div> |
| 205 | + </div> |
| 206 | +
|
| 207 | + <h2>Quick Start</h2> |
| 208 | + <pre><code>use quickchpl; |
| 209 | +
|
| 210 | +// Define a property |
| 211 | +var prop = property("addition commutes", |
| 212 | + tupleGen(intGen(), intGen()), |
| 213 | + lambda((a, b): (int, int)) { return a + b == b + a; }); |
| 214 | + |
| 215 | +// Check the property |
| 216 | +var result = check(prop); |
| 217 | +assert(result.passed);</code></pre> |
| 218 | + |
| 219 | + <h2>Links</h2> |
| 220 | + <p> |
| 221 | + <a href="https://github.com/Jesssullivan/quickchpl">GitHub Repository</a> | |
| 222 | + <a href="https://github.com/Jesssullivan/quickchpl/tree/main/examples">Examples</a> | |
| 223 | + <a href="https://github.com/Jesssullivan/quickchpl/blob/main/README.md">README</a> |
| 224 | + </p> |
| 225 | + </div> |
| 226 | + </body> |
| 227 | + </html> |
| 228 | + HTMLEOF |
| 229 | + artifacts: |
| 230 | + paths: |
| 231 | + - public |
| 232 | + only: |
| 233 | + - main |
0 commit comments