Skip to content

Commit

Permalink
Fix/run-all-tests (#28)
Browse files Browse the repository at this point in the history
fix(workflows): update test command in build workflow to use run-many
for improved test execution handling
  • Loading branch information
codemile authored Aug 20, 2024
1 parent 35bda84 commit 5b95ab0
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
concurrency: "build"

env:
NX_PARALLEL: 1
NX: node_modules/.bin/nx

jobs:
Expand Down Expand Up @@ -89,7 +90,7 @@ jobs:
uses: ./.github/actions/install

- name: "🔨 Test"
run: ${{ env.NX }} run -t test --passWithNoTests
run: ${{ env.NX }} run-many -t test --passWithNoTests

build:
runs-on: ubuntu-latest
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ jobs:
success:
runs-on: ubuntu-latest
needs: [ build ]
if: ${{ always() }}
steps:
- name: "Debug needs.build.result"
run: echo "needs.build.result ${{ needs.build.result }}"

- name: "✅ Success"
if: ${{ needs.build.result == 'success' }}
run: echo "::notice title={Success}::This step triggers auto merge if all dependencies are met."

- name: "❌ Failure"
if: ${{ needs.build.result != 'success' }}
run: |
echo "::error title={Failure}::This step stops the auto merge process."
exit 1
outputs:
success: "true"
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:
concurrency: "release"

env:
NX_PARALLEL: 1
NX: node_modules/.bin/nx

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
concurrency: "website"

env:
NX_PARALLEL: 1
NX: node_modules/.bin/nx

jobs:
Expand Down
5 changes: 2 additions & 3 deletions apps/server/src/config/find-folder.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { promises as fs } from 'fs';
import path from 'path';
import { AIGRAPHR_FOLDER } from '../workspaces/workspaces.tokens';
import { findFolder } from './find-folder';

jest.mock('fs', () => ({
Expand All @@ -15,7 +14,7 @@ const notFound: NodeJS.ErrnoException = new Error('Not found');
notFound.code = 'ENOENT';

describe('findFolder', () => {
const find = AIGRAPHR_FOLDER;
const find = '.aigraphr';

beforeEach(() => {
jest.clearAllMocks();
Expand Down Expand Up @@ -63,7 +62,7 @@ describe('findFolder', () => {
});

it('should return undefined if the root directory is reached', async () => {
const start = path.resolve(path.sep);
const start = path.resolve(path.sep);

mockStat.mockRejectedValue(notFound);

Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"homepage": "https://aigraphr.com/",
"private": false,
"scripts": {
"dev": "bash -c './dev.sh start'",
"dev:help": "bash -c './dev.sh --help'",
"dev:compile": "bash -c './dev.sh compile'",
"dev:init": "bash -c './dev.sh init'",
"build": "nx run-many -t build",
"lint": "nx run-many -t lint",
"sort": "npx --yes sort-package-json",
Expand Down

0 comments on commit 5b95ab0

Please sign in to comment.