Skip to content

fix(auth): preserve config on transient server/network errors #490

fix(auth): preserve config on transient server/network errors

fix(auth): preserve config on transient server/network errors #490

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- master
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
ref:
description: "Commit hash for testing metacall/protocol"
required: false
default: "master"
repo:
description: "Repository from which we should clone metacall/protocol"
required: false
default: "metacall/protocol"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
id-token: write
jobs:
protocol:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout Protocol Repository
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.repo }}
ref: ${{ github.event.inputs.ref }}
fetch-depth: 0
fetch-tags: true
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org
- name: Pack Latest Protocol
run: |
npm i
npm run build
npm pack
- uses: actions/upload-artifact@v4
with:
name: metacall-protocol
path: ./metacall-protocol-*.tgz
if-no-files-found: error
ci:
needs: protocol
runs-on: ubuntu-latest
if: always()
steps:
# Required for local tests
- name: Setup MetaCall CLI
run: wget -O - https://raw.githubusercontent.com/metacall/install/master/install.sh | sh
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org
- name: Checkout
uses: actions/checkout@v4
- name: Installing Dependencies
run: npm i
- uses: actions/download-artifact@v8.0.1
if: github.event_name == 'workflow_dispatch'
with:
name: metacall-protocol
- name: Install Latest Protocol
if: github.event_name == 'workflow_dispatch'
run: |
npm uninstall --save @metacall/protocol
npm install --save ./metacall-protocol-*.tgz
npm list @metacall/protocol
- name: Lint
run: npm run lint
- name: Build
run: npm run build
- name: Run Tests (production)
if: github.event_name != 'pull_request'
run: |
echo 'METACALL_AUTH_EMAIL="${{ secrets.METACALL_AUTH_EMAIL }}"' > .env
echo 'METACALL_AUTH_PASSWORD="${{ secrets.METACALL_AUTH_PASSWORD }}"' >> .env
npm run test
# TODO: Coverage is not working properly, review runCLI spawn
# npm run coverage
# # TODO: This depends on: https://github.com/metacall/faas/issues/78
# - name: Run Tests (local)
# run: |
# cd ..
# git clone https://github.com/metacall/faas.git
# cd faas
# npm install
# npm run build
# node dist/index.js --version
# cd ../deploy
# export TEST_DEPLOY_LOCAL="true"
# node ../faas/dist/index.js &
# sleep 10
# mv .env.example .env
# npm run coverage
- name: Publish
if: startsWith(github.ref, 'refs/tags/')
run: |
unset NODE_AUTH_TOKEN
npm publish --provenance