Skip to content

chore(deps): update github actions #335

chore(deps): update github actions

chore(deps): update github actions #335

name: Build and Test API
on:
push:
branches: [main]
pull_request:
branches: [main]
defaults:
run:
working-directory: mobile-api
jobs:
build-and-test:
name: Build and Test API
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout source code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Lint source files
run: npm run lint
- name: Build and start container
run: docker compose -f docker-compose.dev.yml up -d
- name: Sleep for 1 minute
run: sleep 60
- name: Ping container
run: curl localhost:3000/ping
- name: Create .env file
run: cp sample.env .env
- name: Run tests
run: npm test