Modernize linting and configuration setup #6377
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 | |
| defaults: | |
| run: | |
| shell: bash | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - dev | |
| pull_request: | |
| schedule: | |
| # run CI every day even if no PRs/merges occur | |
| - cron: '0 12 * * *' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| tests: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: >- | |
| ${{ (github.event_name == 'pull_request' && fromJSON('["ubuntu-latest"]')) | |
| || fromJSON('["ubuntu-latest", "windows-2025"]') }} | |
| python: >- | |
| ${{ (github.event_name == 'pull_request' && fromJSON('["3.9", "3.12"]')) | |
| || fromJSON('["3.9", "3.10", "3.11", "3.12"]') }} | |
| type: >- | |
| ${{ (github.event_name == 'pull_request' && | |
| fromJSON('["data_dependency", "path_filtering","erc","find_paths","flat","interface", | |
| "printers","slither_config","upgradability"]')) | |
| || fromJSON('["data_dependency", "path_filtering","erc","find_paths","flat","interface", | |
| "printers","slither_config","upgradability", "cli", "dapp", "etherscan", "kspec", | |
| "simil", "truffle"]') }} | |
| exclude: | |
| # Requires nix | |
| - os: windows-2025 | |
| type: dapp | |
| # Requires nvm | |
| - os: windows-2025 | |
| type: truffle | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Install dependencies | |
| run: | | |
| pip install uv | |
| uv sync --group dev | |
| uv run solc-select use 0.4.25 --always-install | |
| uv run solc-select use 0.8.0 --always-install | |
| uv run solc-select use 0.5.1 --always-install | |
| - name: Set up nix | |
| if: matrix.type == 'dapp' | |
| uses: cachix/install-nix-action@v31 | |
| - name: Set up cachix | |
| if: matrix.type == 'dapp' | |
| uses: cachix/cachix-action@v16 | |
| with: | |
| name: dapp | |
| - name: Run Tests | |
| env: | |
| PYTHONUTF8: 1 | |
| TEST_TYPE: ${{ matrix.type }} | |
| GITHUB_ETHERSCAN: ${{ secrets.GITHUB_ETHERSCAN }} | |
| # Export UV_RUN to use in scripts | |
| UV_RUN: "uv run" | |
| run: | | |
| bash "scripts/ci_test_${TEST_TYPE}.sh" |