64 lines
1.5 KiB
YAML
64 lines
1.5 KiB
YAML
name: "Run tests"
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
- reopened
|
|
|
|
env:
|
|
S3_ENDPOINT: "http://localhost:9090"
|
|
|
|
jobs:
|
|
integration-tests:
|
|
services:
|
|
s3mock:
|
|
image: adobe/s3mock:latest
|
|
env:
|
|
COM_ADOBE_TESTING_S3MOCK_STORE_INITIAL_BUCKETS: "integration-test"
|
|
COM_ADOBE_TESTING_S3MOCK_STORE_REGION: "us-east-1"
|
|
ports:
|
|
- "9090:9090"
|
|
name: "Run vitest integration tests"
|
|
runs-on: stackit-docker
|
|
steps:
|
|
- name: Wait for S3Mock
|
|
run: |
|
|
echo "Waiting for S3Mock on $S3_ENDPOINT/favicon.ico"
|
|
|
|
SECONDS=0
|
|
|
|
while true; do
|
|
CURRENT_TIME="$(date +%s)"
|
|
|
|
if curl -sfo /dev/null "$S3_ENDPOINT/favicon.ico"; then
|
|
echo "S3Mock is ready (took $SECONDS seconds)"
|
|
exit 0
|
|
fi
|
|
|
|
if [ "$SECONDS" -ge 30 ]; then
|
|
echo "::error::S3Mock did not start up in time (30s timeout reached)"
|
|
exit 1
|
|
fi
|
|
|
|
sleep 0.2
|
|
done
|
|
|
|
echo "::error::S3Mock did not start up in time"
|
|
exit 1
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "20"
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
- name: Build action
|
|
run: npm run build
|
|
- name: Run tests
|
|
run: npx vitest run
|