|
| 1 | +# NOTE: This name appears in GitHub's Checks API and in workflow's status badge. |
| 2 | +name: ci-lint |
| 3 | + |
| 4 | +# Trigger the workflow when: |
| 5 | +on: |
| 6 | + # A push occurs to one of the matched branches. |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + - master |
| 11 | + - stable/* |
| 12 | + # Or when a pull request event occurs for a pull request against one of the |
| 13 | + # matched branches. |
| 14 | + pull_request: |
| 15 | + branches: |
| 16 | + - main |
| 17 | + - master |
| 18 | + - stable/* |
| 19 | + |
| 20 | +# Cancel in-progress jobs on same branch. |
| 21 | +concurrency: |
| 22 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 23 | + cancel-in-progress: true |
| 24 | + |
| 25 | +env: |
| 26 | + CMAKE_POLICY_VERSION_MINIMUM: 3.5 |
| 27 | + |
| 28 | +jobs: |
| 29 | + lint-markdown: |
| 30 | + name: lint-markdown |
| 31 | + runs-on: ubuntu-latest |
| 32 | + steps: |
| 33 | + - name: Checkout code |
| 34 | + uses: actions/checkout@v4 |
| 35 | + |
| 36 | + - name: Lint markdown |
| 37 | + |
| 38 | + with: |
| 39 | + files: . |
| 40 | + config_file: .markdownlint.yml |
| 41 | + ignore_path: .markdownlintignore |
| 42 | + |
| 43 | + lint-paymaster-relayer: |
| 44 | + name: lint-paymaster-relayer |
| 45 | + runs-on: ubuntu-latest |
| 46 | + steps: |
| 47 | + - name: Checkout code |
| 48 | + uses: actions/checkout@v4 |
| 49 | + |
| 50 | + - name: Setup Python and uv |
| 51 | + uses: astral-sh/setup-uv@v5 |
| 52 | + with: |
| 53 | + python-version: '3.12' |
| 54 | + enable-cache: true |
| 55 | + |
| 56 | + - name: Install dependencies |
| 57 | + working-directory: ./paymaster-relayer |
| 58 | + run: uv sync --dev |
| 59 | + |
| 60 | + - name: Lint Python code |
| 61 | + working-directory: ./paymaster-relayer |
| 62 | + run: uv run ruff check --output-format=github . |
| 63 | + |
| 64 | + lint-solidity: |
| 65 | + name: lint-solidity |
| 66 | + runs-on: ubuntu-latest |
| 67 | + steps: |
| 68 | + - name: Checkout code |
| 69 | + uses: actions/checkout@v4 |
| 70 | + |
| 71 | + - name: Setup Bun |
| 72 | + uses: oven-sh/setup-bun@v1 |
| 73 | + |
| 74 | + - name: Install dependencies |
| 75 | + working-directory: ./contracts |
| 76 | + run: bun install |
| 77 | + |
| 78 | + - name: Lint Solidity code |
| 79 | + working-directory: ./contracts |
| 80 | + run: bun run lint |
0 commit comments