Fix the way pars is supplied to single resonator formulas #5
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
| # This workflow runs on pull requests and nightly | |
| name: pull_request_CPU_py3.12 | |
| on: | |
| # Run tests for every pull request targeting main | |
| pull_request: | |
| branches: | |
| - main | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| run_tests: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Miniforge | |
| uses: conda-incubator/setup-miniconda@v2 | |
| with: | |
| miniforge-version: latest | |
| python-version: "3.12" | |
| - name: Install IDDEFIX | |
| run: | | |
| pip install . | |
| pip install wakis | |
| pip install pytest pytest-cov | |
| - name: Print installed packages | |
| run: conda list | |
| - name: Run pytest (with coverage) | |
| run: | | |
| python -m pytest --cov=iddefix --cov-report=term-missing -vv | |
| - name: Generate coverage summary | |
| run: | | |
| coverage report > coverage.txt | |
| - name: Comment coverage on PR (update if exists) | |
| if: github.event.pull_request.head.repo.fork == false | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const marker = '<!-- iddefix-coverage-comment -->'; | |
| const report = fs.readFileSync('coverage.txt', 'utf8'); | |
| const body = | |
| `${marker}\n` + | |
| `## 🧪 Coverage Report\n\n` + | |
| `\`\`\`\n${report}\n\`\`\`\n` + | |
| `*Updated: ${new Date().toISOString()}*`; | |
| const issue_number = context.issue.number; | |
| const owner = context.repo.owner; | |
| const repo = context.repo.repo; | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner, | |
| repo, | |
| issue_number, | |
| per_page: 100, | |
| }); | |
| const existing = comments.find(c => (c.body || '').includes(marker)); | |
| if (existing) { | |
| await github.rest.issues.updateComment({ | |
| owner, | |
| repo, | |
| comment_id: existing.id, | |
| body, | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| owner, | |
| repo, | |
| issue_number, | |
| body, | |
| }); | |
| } |