Skip to content

feat: setup semantic release #17

feat: setup semantic release

feat: setup semantic release #17

Workflow file for this run

name: test
on:
push:
branches:
- main
pull_request:
paths:
- '**.js'
- '**.mjs'
- '**.ts'
- 'src/**.js'
- 'src/**.mjs'
- 'src/**.ts'
- 'src/**/**.js'
- 'src/**/**.mjs'
- 'src/**/**.ts'
- 'patches/**.patch'
- '.github/**'
workflow_dispatch:
jobs:
run_test:
# Running only on self hosted runner which has tag "tests"
runs-on: [self-hosted, tests]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
environment: test
steps:
- uses: actions/checkout@v4
- name: Set up Docker Compose
uses: docker/setup-compose-action@v1
- name: Set up Docker
run: docker compose -f ./docker-compose.yml up -d
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- id: install
name: Install npm dependencies
run: npm ci --no-audit --silent
- id: build
name: Build
run: npm run build
- id: lint
name: Run lint
run: npm run lint
- id: unit_tests
name: Run unit tests
run: npm test
env:
CI: true
CLIENT_ID: ${{ secrets.CLIENT_ID }}
APP_ID: ${{ secrets.APP_ID }}
- id: e2e_tests
name: Run e2e tests
run: npm run test:e2e
env:
CI: true
CLIENT_ID: ${{ secrets.CLIENT_ID }}
APP_ID: ${{ secrets.APP_ID }}
- name: Post Set up Docker
if: always()
run: |
docker compose -f ./docker-compose.yml down -v
docker volume prune -a -f
containers=$(docker ps -aq)
if [ -n "$containers" ]; then
docker rm -f $containers
else
echo "No containers to remove."
fi