-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: overhaul impl, deps, tooling, and ci
- Loading branch information
1 parent
f09af73
commit 52f8da3
Showing
19 changed files
with
415 additions
and
145 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
name: 🏎 Test & Publish Adapter | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
# Perform a release using a workflow dispatch | ||
workflow_dispatch: | ||
inputs: | ||
# See https://github.com/hyper63/hyper-ci-bump#inputs for available inputs for the bump action | ||
version: | ||
description: the semver version to bump to | ||
required: true | ||
|
||
jobs: | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
deno-version: [1.x] | ||
|
||
steps: | ||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: 🦕 Setup Deno | ||
uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: ${{ matrix.deno-version }} | ||
|
||
- name: ⚡ Run Tests | ||
run: | | ||
deno task test | ||
env: | ||
CI: true | ||
|
||
bump: | ||
# Releases are performed via a workflow dispatch | ||
if: github.event_name == 'workflow_dispatch' | ||
runs-on: ubuntu-latest | ||
needs: [test] | ||
steps: | ||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: 👀 Env | ||
run: | | ||
echo "Event name: ${{ github.event_name }}" | ||
echo "Git ref: ${{ github.ref }}" | ||
echo "GH actor: ${{ github.actor }}" | ||
echo "SHA: ${{ github.sha }}" | ||
VER=`node --version`; echo "Node ver: $VER" | ||
VER=`npm --version`; echo "npm ver: $VER" | ||
- name: 🤓 Set Git User | ||
run: | | ||
git config --global user.name "${{ github.actor }}" | ||
git config --global user.email "${{ github.actor }}@users.noreply.github.com" | ||
- name: ✊ Bump | ||
id: bump | ||
uses: hyper63/hyper-ci-bump@main | ||
with: | ||
bump-to: ${{ github.event.inputs.version }} | ||
|
||
- name: ⬆️ Push | ||
run: | | ||
git push | ||
git push --tags | ||
- name: 🤖 Create Github Release | ||
if: steps.bump.outputs.tag | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ steps.bump.outputs.tag }} | ||
|
||
publish: | ||
if: github.event_name == 'workflow_dispatch' | ||
runs-on: ubuntu-latest | ||
needs: [bump] | ||
steps: | ||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: 🛠 Build Executables | ||
run: deno task compile | ||
env: | ||
CI: true | ||
|
||
- name: 🤫 Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-1 | ||
|
||
- name: 🗄 Upload Executables to S3 | ||
run: | | ||
aws s3 cp --acl public-read ./hyper-copy s3://hyperland | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hyper-copy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,2 @@ | ||
image: | ||
file: .gitpod.Dockerfile | ||
|
||
github: | ||
prebuilds: | ||
# enable for the default branch (defaults to true) | ||
master: true | ||
# enable for all branches in this repo (defaults to false) | ||
branches: false | ||
# enable for pull requests coming from this repo (defaults to true) | ||
pullRequests: true | ||
# enable for pull requests coming from forks (defaults to false) | ||
pullRequestsFromForks: false | ||
# add a check to pull requests (defaults to true) | ||
addCheck: true | ||
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false) | ||
addComment: false | ||
# add a "Review in Gitpod" button to the pull request's description (defaults to false) | ||
addBadge: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
deno task staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"*.{md,json,js,ts}": ["deno fmt"], | ||
"README.md": ["deno run -A --no-lock npm:markdown-toc-gen@1 insert", "deno fmt"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
{ | ||
"deno.enable": true, | ||
"deno.lint": true, | ||
"deno.unstable": true, | ||
"deno.importMap": "./import_map.json", | ||
} | ||
"deno.enable": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { assertEquals } from 'https://deno.land/[email protected]/testing/asserts.ts'; | ||
|
||
import { crocks } from './deps.js'; | ||
import copy from './copy.js'; | ||
const { Async } = crocks; | ||
|
||
const test = Deno.test; | ||
const list = () => | ||
Async.Resolved({ ok: true, docs: [{ id: '1', type: 'foo' }, { id: '2', type: 'bar' }] }); | ||
const bulk = () => | ||
Async.Resolved({ ok: true, results: [{ ok: true, id: '1' }, { ok: true, id: '2' }] }); | ||
|
||
const cp = copy(list, bulk); | ||
|
||
test('return last key', async () => { | ||
const key = await cp(2, '').toPromise(); | ||
assertEquals(key, '2'); | ||
}); | ||
|
||
test('return finished', async () => { | ||
const key = await cp(1001, '').toPromise(); | ||
assertEquals(key, '__FINISHED__'); | ||
}); | ||
|
||
test('error', async () => { | ||
const b = () => Async.Resolved({ ok: false }); | ||
const cp2 = copy(list, b); | ||
try { | ||
await cp2(1001, '').toPromise(); | ||
} catch (err) { | ||
assertEquals(err, 'Error Copying Data'); | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json", | ||
"description": "Copy documents from one hyper Data Service to another hyper Data Service", | ||
"tasks": { | ||
"cache": "deno cache --lock=deno.lock --lock-write ./deps.js", | ||
"compile": "deno compile --allow-net --unstable --no-check --output hyper-copy mod.js", | ||
"prepare": "deno run -A --no-lock npm:husky@^9", | ||
"staged": "deno run -A --no-lock npm:lint-staged@^15", | ||
"test": "deno lint && deno test --no-lock -A" | ||
}, | ||
"lint": { | ||
"rules": { | ||
"tags": ["recommended"] | ||
} | ||
}, | ||
"fmt": { | ||
"useTabs": false, | ||
"lineWidth": 100, | ||
"indentWidth": 2, | ||
"singleQuote": true | ||
} | ||
} |
Oops, something went wrong.