Skip to content

Feature/mock s3 operations #15

Feature/mock s3 operations

Feature/mock s3 operations #15

Workflow file for this run

name: ci-node.js
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
test:
name: Build and Test
runs-on: ubuntu-22.04
services:
localstack:
image: localstack/localstack
ports:
- 4566:4566
env:
SERVICES: s3
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DEBUG: 1
SKIP_SSL_CERT_DOWNLOAD: 1
strategy:
matrix:
node: [18, 20]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2.4.0
with:
version: 8
- uses: actions/setup-node@v4
name: Use Node.js ${{ matrix.node }}
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install dependencies
run: pnpm install
- name: Check LocalStack readiness
run: |
while ! nc -z localhost 4566; do
echo "Waiting for LocalStack to be ready..."
sleep 1
done
echo "LocalStack is ready for use!"
- name: Run tests with coverage
run: pnpm run test:coverage
env:
IS_OFFLINE: true
AWS_ENDPOINT_URL: localhost:4566
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
- uses: codecov/codecov-action@v3
name: Upload coverage reports to Codecov
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage
files: ./cobertura-coverage.xml
fail_ci_if_error: true
verbose: true