Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,45 @@ on:
- release

jobs:
# Runs Optic End to End Tests to ensure the the build is good before deploying
# Root dependency
test-optic:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: 12
- run: echo "::add-path::$(yarn global bin)"
- name: Check out Optic Repo
uses: actions/checkout@v2
with:
path: ./optic-repo
- name: Release Optic Locally
run: |
source sourceme.sh && optic_local_registry_start
source sourceme.sh && optic_build_and_publish_locally
working-directory: ./optic-repo
- uses: actions/checkout@v2
with:
repository: opticdev/optic-end-end-tests
token: ${{ secrets.END_TO_END_ACCESS_KEY }}
path: ./tests
- run: npm install
working-directory: ./tests
- run: npm test
working-directory: ./tests
env:
DEBUG: "*,-babel*" # Helps with tracing errors

# Deploys the current version to NPM, and also verifies that the version is correct in the process
# All Jobs rely on this job because it verifies the version
# All Jobs rely on this job because it verifies the version and because it depends on test-optic
release-npm:
runs-on: ubuntu-latest
needs: test-optic
steps:
- uses: actions/checkout@v2
with:
ref: release
ref: release
- uses: actions/setup-node@v1
with:
node-version: 12
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/testEndtoEnd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Test end to end

on:
pull_request:
branches:
- develop
- release

jobs:
test-end-to-end:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: 12
- run: echo "::add-path::$(yarn global bin)"
- name: Check out Optic Repo
uses: actions/checkout@v2
with:
path: ./optic-repo
- name: Release Optic Locally
run: |
source sourceme.sh && optic_local_registry_start
source sourceme.sh && optic_build_and_publish_locally
working-directory: ./optic-repo
- uses: actions/checkout@v2
with:
repository: opticdev/optic-end-end-tests
token: ${{ secrets.END_TO_END_ACCESS_KEY }}
path: ./tests
- run: npm install
working-directory: ./tests
- run: npm test
working-directory: ./tests
env:
DEBUG: "*,-babel*" # Helps with tracing errors
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

7 changes: 5 additions & 2 deletions docker/private-npm-registry/conf/config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
storage: /verdaccio/storage
store:
memory:
limit: 1000
packages:
'@useoptic/*':
access: $all
publish: $all
proxy: npmjs
'*/*':
access: $all
proxy: npmjs
Expand All @@ -13,4 +16,4 @@ uplinks:
npmjs:
url: https://registry.npmjs.org/
logs:
- {type: stdout, format: pretty, level: trace}
- {type: stdout, format: pretty, level: trace}
12 changes: 3 additions & 9 deletions docker/private-npm-registry/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
version: '2.1'
services:
verdaccio:
image: verdaccio/verdaccio:4
container_name: verdaccio-docker-local-storage-vol
image: verdaccio/verdaccio:4.6
container_name: verdaccio-local-registry
ports:
- "4873:4873"
volumes:
- "./storage:/verdaccio/storage"
- "./conf:/verdaccio/conf"
volumes:
verdaccio:
driver: local
- "4873:4873"
17 changes: 16 additions & 1 deletion sourceme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ optic_build_and_publish_locally() {
set -o errexit
optic_build_for_release
cd "$OPTIC_SRC_DIR"
yarn run publish-local
npm-cli-login -u testUser -p testPass -e test@example.com -r http://localhost:4873
OPTIC_PUBLISH_SCOPE=private node ./workspaces/scripts/publish.js
)
}
optic_release_and_install_locally() {
Expand All @@ -113,3 +114,17 @@ optic_install_from_local_registry() {
)
}
# DEBUG=optic* apidev daemon:stop && DEBUG=optic* apidev agent:start
optic_local_registry_start() {
(
set -o errexit
cd "$OPTIC_SRC_DIR"
cd docker/private-npm-registry
yarn global add verdaccio-memory npm-cli-login
docker-compose up &

cd "$OPTIC_SRC_DIR"
yarn install
yarn wait-on http://localhost:4873
printf "local npm registry started on http://localhost:4873 \n"
)
}
2 changes: 1 addition & 1 deletion workspaces/scripts/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ promise
'npm',
isPrivatePublish
? ['publish', '--registry', registry]
: ['publish', '--access', 'public'],
: ['publish', '--access', 'public', '-ddd'],
{
cwd,
stdio: 'inherit',
Expand Down