Fix TypeError when use cpu buffer (#188) #259
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: Code Quality | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: ['main'] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - 'LICENSE' | |
| - '.gitignore' | |
| pull_request: | |
| branches: ['main', '*-dev'] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - 'LICENSE' | |
| - '.gitignore' | |
| permissions: | |
| contents: read | |
| statuses: write | |
| jobs: | |
| pre-commit: | |
| name: Check code quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 | |
| with: | |
| disable-sudo-and-containers: true | |
| egress-policy: block | |
| allowed-endpoints: > | |
| github.com:443 | |
| pypi.org:443 | |
| files.pythonhosted.org:443 | |
| atomgit.com:443 | |
| api.github.com:443 | |
| - name: Checkout code | |
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| with: | |
| # for setuptools-scm | |
| fetch-depth: 0 | |
| submodules: true | |
| - name: Setup Python 3.11 | |
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| with: | |
| python-version: "3.11" | |
| - name: Run code quality checks - lint, format, spell, & static checks | |
| uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 | |
| with: | |
| extra_args: --all-files | |
| - name: 🟡 Set Hardware Test to Pending | |
| if: success() | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const { owner, repo } = context.repo; | |
| const sha = context.payload.pull_request ? context.payload.pull_request.head.sha : context.sha; | |
| try { | |
| await github.rest.repos.createCommitStatus({ | |
| owner, | |
| repo, | |
| sha, | |
| state: 'pending', | |
| description: 'Queued (Waiting for runner pick-up)...', | |
| context: '910B Unit Tests Status' | |
| }); | |
| } catch (error) { | |
| // 403 means "Forbidden" (likely a Fork PR). We ignore it. | |
| if (error.status === 403) { | |
| console.log('⚠️ Could not set status (likely a Fork PR with read-only token). Skipping.'); | |
| return; // Exit gracefully | |
| } | |
| // If it's another error, throw it so we know | |
| throw error; | |
| } |