move linting complete into extra job

This commit is contained in:
einhornimmond 2025-05-04 11:08:01 +02:00
parent c630d403e9
commit 446beaa702
4 changed files with 69 additions and 34 deletions

View File

@ -5,6 +5,12 @@ on: push
jobs:
lint:
runs-on: ubuntu-latest
outputs:
config-schema: ${{ steps.changes.outputs.config-schema }}
backend: ${{ steps.changes.outputs.backend }}
database: ${{ steps.changes.outputs.database }}
dht-node: ${{ steps.changes.outputs.dht-node }}
federation: ${{ steps.changes.outputs.federation }}
steps:
- name: Checkout
uses: actions/checkout@v4
@ -13,12 +19,67 @@ jobs:
with:
version: latest
- name: Lint - Config-Schema
run: cd ./config-schema && biome ci .
id: config-schema
run: |
cd ./config-schema && biome ci .
echo "success=$([ $? -eq 0 ] && echo true || echo false)" >> $GITHUB_OUTPUT
- name: Lint - Backend
run: cd ./backend && biome ci .
id: backend
run: |
cd ./backend && biome ci .
echo "success=$([ $? -eq 0 ] && echo true || echo false)" >> $GITHUB_OUTPUT
- name: Lint - Database Up
run: cd ./database && biome ci .
id: database
run: |
cd ./database && biome ci .
echo "success=$([ $? -eq 0 ] && echo true || echo false)" >> $GITHUB_OUTPUT
- name: Lint - DHT Node
run: cd ./dht-node && biome ci .
id: dht-node
run: |
cd ./dht-node && biome ci .
echo "success=$([ $? -eq 0 ] && echo true || echo false)" >> $GITHUB_OUTPUT
- name: Lint - Federation
run: cd ./federation && biome ci .
id: federation
run: |
cd ./federation && biome ci .
echo "success=$([ $? -eq 0 ] && echo true || echo false)" >> $GITHUB_OUTPUT
lint_config_schema:
name: Lint - Config-Schema
needs: lint
runs-on: ubuntu-latest
steps:
- name: Check result from previous step
run: if [ "${{ needs.lint.outputs.config-schema }}" != "true" ]; then exit 1; fi
lint_backend:
name: Lint - Backend
needs: lint
runs-on: ubuntu-latest
steps:
- name: Check result from previous step
run: if [ "${{ needs.lint.outputs.backend }}" != "true" ]; then exit 1; fi
lint_database:
name: Lint - Database Up
needs: lint
runs-on: ubuntu-latest
steps:
- name: Check result from previous step
run: if [ "${{ needs.lint.outputs.database }}" != "true" ]; then exit 1; fi
lint_dht_node:
name: Lint - DHT Node
needs: lint
runs-on: ubuntu-latest
steps:
- name: Check result from previous step
run: if [ "${{ needs.lint.outputs.dht-node }}" != "true" ]; then exit 1; fi
lint_federation:
name: Lint - Federation
needs: lint
runs-on: ubuntu-latest
steps:
- name: Check result from previous step
run: if [ "${{ needs.lint.outputs.federation }}" != "true" ]; then exit 1; fi

View File

@ -62,7 +62,7 @@ jobs:
run: cd out && yarn install --frozen-lockfile --production=false
- name: Locales - Backend
run: cd out && yarn locales
run: cd out/backend && yarn locales
- name: Wait for MariaDB to be ready
run: docker run --rm --network gradido_internal-net busybox sh -c 'until nc -z mariadb 3306; do echo waiting for db; sleep 1; done;'

View File

@ -39,8 +39,6 @@ jobs:
if: needs.files-changed.outputs.config == 'true' || needs.files-changed.outputs.database == 'true' || needs.files-changed.outputs.dht_node == 'true' || needs.files-changed.outputs.docker-compose == 'true'
needs: files-changed
runs-on: ubuntu-latest
outputs:
test-success: ${{ steps.test.outputs.success }}
steps:
- name: Set Node.js version
uses: actions/setup-node@v4
@ -66,16 +64,5 @@ jobs:
run: docker run --rm --network gradido_internal-net busybox sh -c 'until nc -z mariadb 3306; do echo waiting for db; sleep 1; done;'
- name: run unit test & lint & build & typecheck
id: test
run: |
cd out && turbo dht-node#lint dht-node#test dht-node#build dht-node#typecheck
echo "success=$([ $? -eq 0 ] && echo true || echo false)" >> $GITHUB_OUTPUT
run: cd out && turbo dht-node#lint dht-node#test dht-node#build dht-node#typecheck
lint:
name: Lint - DHT Node
if: needs.files-changed.outputs.dht_node == 'true'
needs: [files-changed, unit_test]
runs-on: ubuntu-latest
steps:
- name: Check result from previous step
run: if [ "${{ needs.unit_test.outputs.test-success }}" != "true" ]; then exit 1; fi

View File

@ -39,8 +39,6 @@ jobs:
if: needs.files-changed.outputs.database == 'true' || needs.files-changed.outputs.docker-compose == 'true' || needs.files-changed.outputs.federation == 'true' || needs.files-changed.outputs.mariadb == 'true'
needs: files-changed
runs-on: ubuntu-latest
outputs:
test-success: ${{ steps.test.outputs.success }}
steps:
- name: Set Node.js version
uses: actions/setup-node@v4
@ -67,15 +65,4 @@ jobs:
- name: Federation | Unit tests
id: test
run: |
cd out && turbo federation#lint federation#test federation#build federation#typecheck
echo "success=$([ $? -eq 0 ] && echo true || echo false)" >> $GITHUB_OUTPUT
lint:
name: Lint - Federation
if: needs.files-changed.outputs.federation == 'true'
needs: [files-changed, unit_test]
runs-on: ubuntu-latest
steps:
- name: Check result from previous step
run: if [ "${{ needs.unit_test.outputs.test-success }}" != "true" ]; then exit 1; fi
run: cd out && turbo federation#lint federation#test federation#build federation#typecheck