Add rule based integration method #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: ['*'] | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| actions: write | |
| contents: write | |
| concurrency: | |
| # Skip intermediate builds: always. | |
| # Cancel intermediate builds: only if it is a pull request build. | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
| jobs: | |
| test: | |
| name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 60 | |
| permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created | |
| actions: write | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: | |
| - '1.11' | |
| - 'pre' | |
| os: | |
| - ubuntu-latest | |
| arch: | |
| - x64 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: ${{ matrix.version }} | |
| arch: ${{ matrix.arch }} | |
| - uses: julia-actions/cache@v2 | |
| - uses: julia-actions/julia-buildpkg@v1 | |
| - name: Run tests and count rules | |
| if: matrix.version == '1.11' && matrix.os == 'ubuntu-latest' | |
| run: | | |
| julia --project=. -e " | |
| using SymbolicIntegration | |
| using Pkg | |
| rules_count = length(SymbolicIntegration.RULES) | |
| println(\"Total rules: \$rules_count\") | |
| # Create directory if it doesn't exist | |
| mkpath(\".github/badges\") | |
| # Write the JSON file manually (no JSON package needed) | |
| open(\".github/badges/rules-count.json\", \"w\") do f | |
| println(f, \"{\") | |
| println(f, \" \\\"schemaVersion\\\": 1,\") | |
| println(f, \" \\\"label\\\": \\\"Total rules\\\",\") | |
| println(f, \" \\\"message\\\": \\\"\$rules_count\\\",\") | |
| println(f, \" \\\"color\\\": \\\"blue\\\"\") | |
| println(f, \"}\") | |
| end | |
| println(\"Badge data written to .github/badges/rules-count.json\") | |
| Pkg.test() | |
| " | |
| id: count_rules | |
| - name: Commit badge data | |
| if: matrix.version == '1.11' && matrix.os == 'ubuntu-latest' && github.ref == 'refs/heads/main' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add .github/badges/rules-count.json | |
| if git diff --staged --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m "Update rules count badge [skip ci]" | |
| git push | |
| fi | |
| - name: Run tests (other configurations) | |
| if: ${{ !(matrix.version == '1.11' && matrix.os == 'ubuntu-latest') }} | |
| uses: julia-actions/julia-runtest@v1 |