Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

feat: add support to asyncLocalStorage #253

feat: add support to asyncLocalStorage

feat: add support to asyncLocalStorage #253

Workflow file for this run

name: CI/CD
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
create:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
build-and-unit-test:
strategy:
matrix:
node-version: [18.x]
os: [ubuntu-latest, macos-latest]
name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- run: |
git config --global user.name github-actions
git config --global user.email [email protected]
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Installing dependencies
run: npm ci
- name: Building
run: npm run build --if-present
- name: Running lint
run: npm run lint
- name: Running tests
run: npm test
e2e-test:
needs: build-and-unit-test
strategy:
matrix:
node-version: [18.x]
os: [ubuntu-latest]
name: E2E Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Start containers
run: docker compose up -d
shell: bash
- name: Installing dependencies
run: npm ci
- name: Building
run: npm run build --if-present
- name: login
run: npx npm-cli-login -u test -p 1234 -e [email protected] -r http://localhost:4873
- name: publish
run: npm publish --registry http://localhost:4873
- name: check
run: npm info azion-framework-adapter --json --registry http://localhost:4873
- name: install global
run: npm install -g azion-framework-adapter --registry http://localhost:4873
- name: Test E2E
run: npm run e2e
- name: Stop containers
if: always()
run: docker-compose -f "docker-compose.yml" down
publish:
needs: e2e-test
if: ${{ github.repository == 'aziontech/azion-framework-adapter' && github.event_name == 'create' && github.ref_type == 'tag' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Installing dependencies
run: npm ci
- name: Building
run: npm run build --if-present
- name: Set Azfa version
run: echo "AZFA_VERSION=v$(awk -F\" '/"version":/ {print $4}' package.json)" >> $GITHUB_ENV
- name: Set Release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Show versions
run: |
echo "Version on tag: ${{ env.RELEASE_VERSION }}"
echo "New Azfa version ${{ env.AZFA_VERSION }}"
- name: Publish new version
if: ${{ env.AZFA_VERSION == env.RELEASE_VERSION }}
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}