|
| 1 | +name: Validate maintained examples |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + workflow_dispatch: |
| 9 | + schedule: |
| 10 | + - cron: "0 6 * * 1" |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + |
| 15 | +jobs: |
| 16 | + python: |
| 17 | + name: Python ${{ matrix.python-version }} |
| 18 | + runs-on: ubuntu-latest |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + python-version: ["3.10", "3.11", "3.12"] |
| 23 | + steps: |
| 24 | + - name: Check out the repository |
| 25 | + uses: actions/checkout@v7 |
| 26 | + |
| 27 | + - name: Set up Python |
| 28 | + uses: actions/setup-python@v7 |
| 29 | + with: |
| 30 | + python-version: ${{ matrix.python-version }} |
| 31 | + cache: pip |
| 32 | + cache-dependency-path: | |
| 33 | + custom-connector/pyproject.toml |
| 34 | + custom-graphql/pyproject.toml |
| 35 | + dynamic_csv_importer/requirements.txt |
| 36 | + api-lineage-cicd/requirements.txt |
| 37 | + ingestion-automation/requirements.txt |
| 38 | +
|
| 39 | + - name: Install exact OpenMetadata RC and test dependencies |
| 40 | + run: | |
| 41 | + python -m pip install --upgrade pip |
| 42 | + python -m pip install --editable './custom-connector[test]' |
| 43 | + python -m pip install --editable ./custom-graphql |
| 44 | + python -m pip install \ |
| 45 | + --requirement dynamic_csv_importer/requirements.txt \ |
| 46 | + --requirement api-lineage-cicd/requirements.txt \ |
| 47 | + --requirement ingestion-automation/requirements.txt |
| 48 | +
|
| 49 | + - name: Verify the installed OpenMetadata version |
| 50 | + run: | |
| 51 | + python - <<'PY' |
| 52 | + from importlib.metadata import version |
| 53 | +
|
| 54 | + assert version("openmetadata-ingestion") == "2.0.0.0rc1" |
| 55 | + PY |
| 56 | +
|
| 57 | + - name: Compile Python sources |
| 58 | + run: >- |
| 59 | + python -m compileall -q |
| 60 | + custom-connector/src |
| 61 | + custom-connector/tests |
| 62 | + custom-graphql |
| 63 | + dynamic_csv_importer |
| 64 | + api-lineage-cicd |
| 65 | + ingestion-automation |
| 66 | + tests |
| 67 | +
|
| 68 | + - name: Lint and check formatting |
| 69 | + run: | |
| 70 | + ruff check . |
| 71 | + ruff format --check . |
| 72 | +
|
| 73 | + - name: Run model, configuration, import, and request tests |
| 74 | + run: pytest |
| 75 | + |
| 76 | + node: |
| 77 | + name: Node fixture |
| 78 | + runs-on: ubuntu-latest |
| 79 | + defaults: |
| 80 | + run: |
| 81 | + working-directory: custom-graphql/server |
| 82 | + steps: |
| 83 | + - name: Check out the repository |
| 84 | + uses: actions/checkout@v7 |
| 85 | + |
| 86 | + - name: Set up Node.js |
| 87 | + uses: actions/setup-node@v7 |
| 88 | + with: |
| 89 | + node-version: 24 |
| 90 | + cache: npm |
| 91 | + cache-dependency-path: custom-graphql/server/package-lock.json |
| 92 | + |
| 93 | + - name: Install locked dependencies |
| 94 | + run: npm ci --ignore-scripts |
| 95 | + |
| 96 | + - name: Audit dependencies |
| 97 | + run: npm audit --audit-level=high |
| 98 | + |
| 99 | + - name: Check JavaScript syntax |
| 100 | + run: | |
| 101 | + node --check index.js |
| 102 | + node --check resolvers.js |
| 103 | + node --check schema.js |
| 104 | +
|
| 105 | + compose: |
| 106 | + name: Docker Compose configuration |
| 107 | + runs-on: ubuntu-latest |
| 108 | + steps: |
| 109 | + - name: Check out the repository |
| 110 | + uses: actions/checkout@v7 |
| 111 | + |
| 112 | + - name: Download the official OpenMetadata 2.0 RC1 Compose file |
| 113 | + run: >- |
| 114 | + curl --fail --silent --show-error --location |
| 115 | + --output "${RUNNER_TEMP}/docker-compose-postgres.yml" |
| 116 | + https://github.com/open-metadata/OpenMetadata/releases/download/2.0.0-rc1-release/docker-compose-postgres.yml |
| 117 | +
|
| 118 | + - name: Validate the Compose overlay |
| 119 | + run: >- |
| 120 | + docker compose |
| 121 | + --project-directory "${GITHUB_WORKSPACE}" |
| 122 | + --file "${RUNNER_TEMP}/docker-compose-postgres.yml" |
| 123 | + --file custom-connector/docker/compose.override.yml |
| 124 | + config --quiet |
| 125 | +
|
| 126 | + links: |
| 127 | + name: Markdown links |
| 128 | + runs-on: ubuntu-latest |
| 129 | + steps: |
| 130 | + - name: Check out the repository |
| 131 | + uses: actions/checkout@v7 |
| 132 | + |
| 133 | + - name: Check Markdown links |
| 134 | + uses: lycheeverse/lychee-action@v2.9.0 |
| 135 | + with: |
| 136 | + args: --no-progress --config .lychee.toml './**/*.md' |
| 137 | + fail: true |
| 138 | + |
| 139 | + secrets: |
| 140 | + name: Gitleaks |
| 141 | + runs-on: ubuntu-latest |
| 142 | + steps: |
| 143 | + - name: Check out the repository |
| 144 | + uses: actions/checkout@v7 |
| 145 | + |
| 146 | + - name: Scan the repository |
| 147 | + run: >- |
| 148 | + docker run --rm |
| 149 | + --volume "${GITHUB_WORKSPACE}:/repo" |
| 150 | + zricethezav/gitleaks:v8.27.0 |
| 151 | + dir /repo --redact --no-banner |
0 commit comments