Skip to content

Commit

Permalink
Use composite workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jarodmeng committed Jan 3, 2025
1 parent 948925d commit 288488a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
# Install docker-compose and set up presto/trino servers
- name: Setup Presto and Trino servers
if: matrix.config.os == 'ubuntu-latest'
uses: ./.github/workflows/setup-presto-trino-servers.yml
uses: ./.github/workflows/setup-presto-trino-servers

- uses: r-lib/actions/check-r-package@v2
with:
Expand Down
35 changes: 0 additions & 35 deletions .github/workflows/setup-presto-trino-servers.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/setup-presto-trino-servers/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Setup Presto and Trino Servers'
description: 'Sets up Presto and Trino servers using Docker Compose'
runs:
using: 'composite'
steps:
# Install Docker Compose on Ubuntu
- name: Install Docker Compose on Ubuntu
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
shell: bash

# Start Docker Compose services
- name: Start services with Docker Compose
run: |
docker-compose up -d
shell: bash

# Ensure Presto and Trino servers are running
- name: Wait for Presto and Trino to be ready
run: |
for i in {1..30}; do
if curl -s http://localhost:8080/v1/info && curl -s http://localhost:8090/v1/info; then
echo "Presto and Trino are up and running."
break
fi
echo "Waiting for Presto and Trino to be ready..."
sleep 5
done
if ! curl -s http://localhost:8080/v1/info || ! curl -s http://localhost:8090/v1/info; then
echo "Presto or Trino did not start in time. Exiting."
exit 1
fi
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

# Install docker-compose and set up presto/trino servers
- name: Setup Presto and Trino servers
uses: ./.github/workflows/setup-presto-trino-servers.yml
uses: ./.github/workflows/setup-presto-trino-servers

- name: Test coverage
run: covr::codecov(quiet = FALSE)
Expand Down

0 comments on commit 288488a

Please sign in to comment.