diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 08a41579d..57bef6de0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 . \ No newline at end of file + 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 \ No newline at end of file diff --git a/.github/workflows/test_backend.yml b/.github/workflows/test_backend.yml index 33d345dc4..6c3dae05b 100644 --- a/.github/workflows/test_backend.yml +++ b/.github/workflows/test_backend.yml @@ -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;' diff --git a/.github/workflows/test_dht_node.yml b/.github/workflows/test_dht_node.yml index 6aee0b4cc..1fd2045bf 100644 --- a/.github/workflows/test_dht_node.yml +++ b/.github/workflows/test_dht_node.yml @@ -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 diff --git a/.github/workflows/test_federation.yml b/.github/workflows/test_federation.yml index 46350853c..bd670912c 100644 --- a/.github/workflows/test_federation.yml +++ b/.github/workflows/test_federation.yml @@ -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 \ No newline at end of file