Skip to content

ci: remove fork-only Qodana workflow #33

ci: remove fork-only Qodana workflow

ci: remove fork-only Qodana workflow #33

Workflow file for this run

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Fork-only CI.
#
# The upstream workflows (test.yml, test-e2e.yml, config-ui.yml,
# asf-header-check.yml, ...) only trigger on `push` to `main` and on
# `pull_request` with base `main`/`release-*`. In this fork we work on feature
# branches (`pr/**`, `fix/**`, ...) and often stack pull requests on top of each
# other, so those workflows never run before a PR is opened upstream.
#
# On top of that, the upstream jobs run inside `mericodev/lake-builder:latest`,
# an image only the upstream maintainers can publish. Its published build is
# stale (Go 1.20, libgit2 1.3.2, mockery v2), so every branch that upgrades
# dependencies fails with errors that have nothing to do with the change
# itself. This workflow therefore builds the builder image from
# `devops/docker/lake-builder/Dockerfile` (the very file such branches update)
# and publishes it to GHCR, keyed by the Dockerfile hash so it is only rebuilt
# when the recipe changes.
#
# Guarded so it never runs in `apache/devlake` should the file ever be merged
# upstream.
name: fork-ci
on:
push:
branches-ignore:
- main
pull_request:
branches-ignore:
- main
workflow_dispatch:
concurrency:
group: fork-ci-${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
packages: write
jobs:
builder-image:
name: builder image
if: github.repository != 'apache/devlake'
runs-on: ubuntu-latest
outputs:
image: ${{ steps.meta.outputs.image }}
steps:
- uses: actions/checkout@v6
- name: Compute image reference
id: meta
run: |
owner=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
tag=$(sha256sum devops/docker/lake-builder/Dockerfile | cut -c1-12)
echo "image=ghcr.io/$owner/lake-builder:$tag" >> "$GITHUB_OUTPUT"
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: devops/docker/lake-builder
push: true
tags: ${{ steps.meta.outputs.image }}
cache-from: type=gha
cache-to: type=gha,mode=max
golangci-lint:
name: lint (go)
needs: builder-image
runs-on: ubuntu-latest
container:
image: ${{ needs.builder-image.outputs.image }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6
- run: git config --global --add safe.directory $(pwd)
- name: generate mock
run: |
go version
cd backend
make mock
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.12.2
working-directory: ./backend
migration-script-lint:
name: migration-script-lint
needs: builder-image
runs-on: ubuntu-latest
container:
image: ${{ needs.builder-image.outputs.image }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6
- run: git config --global --add safe.directory $(pwd)
- name: migration script linting
run: |
go version
cd backend
go run core/migration/linter/main.go -p backend $(find . -path "**/migrationscripts/**.go")
unit-test:
name: unit-test
needs: builder-image
runs-on: ubuntu-latest
container:
image: ${{ needs.builder-image.outputs.image }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6
- run: git config --global --add safe.directory $(pwd)
- name: Build Python
run: |
cd backend
make build-python
- name: Cache go build
uses: actions/cache@v5
with:
path: |
~/.cache/go-build
${{ env.GOPATH }}/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Unit tests
run: |
go version
cp env.example .env
cd backend
make unit-test
e2e-mysql:
name: e2e (mysql)
needs: builder-image
runs-on: ubuntu-latest
services:
db:
image: mysql:8
env:
MYSQL_DATABASE: lake
MYSQL_USER: merico
MYSQL_PASSWORD: merico
MYSQL_ROOT_PASSWORD: root
container:
image: ${{ needs.builder-image.outputs.image }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6
- run: git config --global --add safe.directory $(pwd)
- name: Build Python
run: |
cd backend
make build-python
- name: Cache go build
uses: actions/cache@v5
with:
path: |
~/.cache/go-build
${{ env.GOPATH }}/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test-mysql
env:
DB_URL: mysql://root:root@db:3306/lake?charset=utf8mb4&parseTime=True
E2E_DB_URL: mysql://root:root@db:3306/lake?charset=utf8mb4&parseTime=True
run: |
go version
cp env.example .env
cd backend
make e2e-test-go-plugins
make e2e-test
config-ui:
name: config-ui
if: github.repository != 'apache/devlake'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'yarn'
cache-dependency-path: config-ui/yarn.lock
- name: Install with Yarn
run: cd config-ui; yarn
- name: Run Lint
run: cd config-ui; yarn tsc && yarn lint
asf-header-check:
name: check Apache license header
if: github.repository != 'apache/devlake'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Check License Header
uses: apache/skywalking-eyes@main
grafana-dashboards-check:
name: check grafana dashboards
if: github.repository != 'apache/devlake'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Check grafana dashboards whether using mysql uid
run: |
if grep '"type": "mysql"' grafana/dashboards/*; then
echo "There are dashboards which use mysql uid as datasource"
exit 1
fi