Repository navigation
Fix Rust extension types and simplify type checks #460
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: Build Status | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| checks: write | |
| pull-requests: write | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| template: | |
| - python | |
| - cython | |
| - cpp | |
| - js | |
| - jupyter | |
| - rust | |
| - rustjswasm | |
| - cppjswasm | |
| - uitk-svelte | |
| - uitk-webawesome | |
| - site-react | |
| - site-sveltekit | |
| - site-webawesome | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| exclude: | |
| - template: uitk-svelte | |
| os: macos-latest | |
| - template: uitk-webawesome | |
| os: macos-latest | |
| - template: site-react | |
| os: macos-latest | |
| - template: site-sveltekit | |
| os: macos-latest | |
| - template: site-webawesome | |
| os: macos-latest | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Create fixture files | |
| run: | | |
| # python | |
| touch pyproject.toml | |
| # node | |
| echo '{"name": "a", "version": "0.0.0", "scripts": {}}' > package.json | |
| printf 'lockfileVersion: '9.0'\nsettings:\n\tautoInstallPeers: true\n\texcludeLinksFromLockfile: false\nimporters:\n.: {}' > pnpm-lock.yaml | |
| # rust | |
| printf '[package]\nname = "rust"\nversion = "0.1.0"\nedition = "2021"\n[dependencies]\n' > Cargo.toml | |
| mkdir -p src | |
| printf 'fn main() {\n println!("Hello, world!");\n}\n' > src/main.rs | |
| - name: Setup Python | |
| uses: actions-ext/python/setup@c8228d827a81b9f8c808825328af361c45461ba3 | |
| with: | |
| version: '3.11' | |
| - name: Install Copier | |
| run: uv pip install copier | |
| - name: Install clang-format | |
| run: | | |
| if [[ "$RUNNER_OS" == "Linux" ]]; then | |
| sudo apt-get install -y clang-format-14 | |
| sudo ln -sf /usr/bin/clang-format-14 /usr/bin/clang-format | |
| elif [[ "$RUNNER_OS" == "macOS" ]]; then | |
| brew install clang-format | |
| fi | |
| if: matrix.template == 'cpp' || matrix.template == 'cppjswasm' | |
| - name: Setup Node.js | |
| uses: actions-ext/node/setup@03c9f6b2d9c9fa2c26cfa22d0fa379a69329b319 | |
| with: | |
| version: 22.x | |
| pnpm_version: 11.11.0 | |
| js_folder: "." | |
| if: matrix.template == 'js' || matrix.template == 'jupyter' || matrix.template == 'cppjswasm' || matrix.template == 'rustjswasm' || matrix.template == 'uitk-svelte' || matrix.template == 'uitk-webawesome' || matrix.template == 'site-react' || matrix.template == 'site-sveltekit' || matrix.template == 'site-webawesome' | |
| - name: Setup Rust | |
| uses: actions-ext/rust/setup@10df15e12bbd1cc1cf48089f2e232349f98c74e7 | |
| if: matrix.template == 'rust' || matrix.template == 'rustjswasm' | |
| - name: Install JavaScript dependencies | |
| run: pnpm install | |
| if: matrix.template == 'js' || matrix.template == 'jupyter' || matrix.template == 'cppjswasm' || matrix.template == 'rustjswasm' | |
| - name: Build Rust fixture | |
| run: cargo build | |
| if: matrix.template == 'rust' || matrix.template == 'rustjswasm' | |
| - name: Generate template | |
| run: make gen-${{ matrix.template }} | |
| - name: Install JavaScript template dependencies and browser | |
| run: | | |
| cd ../javascript-template-${{ matrix.template }} | |
| pnpm install | |
| pnpm exec playwright install --with-deps chromium | |
| if: matrix.template == 'uitk-svelte' || matrix.template == 'uitk-webawesome' || matrix.template == 'site-react' || matrix.template == 'site-sveltekit' || matrix.template == 'site-webawesome' | |
| - name: Test template | |
| run: make test-${{ matrix.template }} | |
| - name: Check types with Pyodide enabled | |
| run: | | |
| copier copy --defaults --vcs-ref=$(git rev-parse HEAD) . ../python-template-${{ matrix.template }}-pyodide --data-file examples/${{ matrix.template }}.yaml --data add_pyodide=true | |
| make -C ../python-template-${{ matrix.template }}-pyodide check-types | |
| if: matrix.template == 'rust' || matrix.template == 'rustjswasm' | |
| - name: Check source distribution artifacts | |
| run: python .github/scripts/check_sdist_artifacts.py ../python-template-${{ matrix.template }} | |
| env: | |
| HATCH_BUILD_NO_HOOKS: '1' | |
| if: matrix.template == 'cpp' || matrix.template == 'cppjswasm' || matrix.template == 'rust' || matrix.template == 'rustjswasm' |