Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ci): composite the action #120

Merged
merged 2 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 15 additions & 79 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down