diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ac731d4..48fd3702 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,105 +12,41 @@ jobs: setup-dependencies: runs-on: ${{matrix.os}} strategy: + fail-fast: false matrix: os: [ubuntu-latest] - node-version: [16, 18, 20] + node: [18, 20] steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v2.4.0 - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: ${{matrix.node}} cache: 'pnpm' - run: pnpm fetch - ci-cli: + package-tests: needs: setup-dependencies runs-on: ${{matrix.os}} strategy: + fail-fast: false matrix: os: [ubuntu-latest] - node-version: [16, 18] + node: [18, 20] + package: [cli, drill, falcon, huston, rover] steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v2.4.0 - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: ${{matrix.node}} cache: 'pnpm' - run: pnpm install - - run: cd packages/cli && pnpm test - - ci-drill: - needs: setup-dependencies - runs-on: ${{matrix.os}} - timeout-minutes: 20 - strategy: - matrix: - os: [ubuntu-latest] - node-version: [16, 18] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2.4.0 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: 'pnpm' - run: docker-compose up -d - - run: pnpm install - - run: sleep 10 - - run: cd packages/drill && pnpm test - - ci-falcon: - needs: setup-dependencies - runs-on: ${{matrix.os}} - timeout-minutes: 20 - strategy: - matrix: - os: [ubuntu-latest] - node-version: [16, 18] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2.4.0 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: 'pnpm' - - run: docker-compose up -d - - run: pnpm install - - run: sleep 10 - - run: cd packages/falcon && pnpm test - - ci-huston: - needs: setup-dependencies - runs-on: ${{matrix.os}} - strategy: - matrix: - os: [ubuntu-latest] - node-version: [16, 18] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2.4.0 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: 'pnpm' - - run: pnpm install - - run: cd packages/huston && pnpm test - - ci-rover: - needs: setup-dependencies - runs-on: ${{matrix.os}} - strategy: - matrix: - os: [ubuntu-latest] - node-version: [16, 18] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2.4.0 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: 'pnpm' - - run: pnpm install - - run: cd packages/rover && pnpm test + - name: Wait for databases to be healthy + run: | + while [ "$(docker-compose ps mysql | grep '(healthy)')" == "" ] || [ "$(docker-compose ps postgres | grep '(healthy)')" == "" ]; do + echo "Waiting for databases to be healthy..." + sleep 5 + done + - run: cd packages/${{matrix.package}} && pnpm test diff --git a/docker-compose.yml b/docker-compose.yml index 3f4cc0e5..45e5a208 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,11 @@ services: MYSQL_ROOT_PASSWORD: toor networks: - asterism_network + healthcheck: + test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "--password=toor"] + interval: 10s + timeout: 5s + retries: 5 postgres: image: postgres:15-alpine @@ -22,6 +27,11 @@ services: POSTGRES_PASSWORD: toor networks: - asterism_network + healthcheck: + test: ["CMD", "pg_isready", "-U", "postgres", "-d", "db"] + interval: 10s + timeout: 5s + retries: 5 networks: asterism_network: