-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
358 changed files
with
30,926 additions
and
3,470 deletions.
There are no files selected for viewing
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,82 @@ | ||
name: box | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- "test/*" | ||
pull_request: | ||
types: [assigned, opened, synchronize, reopened, labeled] | ||
paths: | ||
- "docker/eden-box.Dockerfile" | ||
- ".eslintignore" | ||
- ".eslintrc.js" | ||
- ".prettierrc.json" | ||
- "lerna.json" | ||
- "packages/box" | ||
- "package.json" | ||
- "tsconfig.build.json" | ||
- "tsconfig.json" | ||
- "yarn.lock" | ||
|
||
jobs: | ||
box-e2e: | ||
name: Eden Box E2E Tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: ✅ Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: 🛠 Build and Start Box | ||
run: | | ||
yarn | ||
cd packages/box | ||
yarn build | ||
yarn start & | ||
- name: 🧪 Run E2E | ||
# TODO: add real E2E tests... for now it's just a shameless curl ping | ||
run: | | ||
curl localhost:3032 | ||
box-build: | ||
needs: box-e2e | ||
name: Build Eden Box | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: ✅ Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Image Preparation | ||
id: prep | ||
run: | | ||
REGISTRY="ghcr.io" | ||
IMAGE="${REGISTRY}/${{ github.repository_owner }}/eden-box" | ||
TAGS="${IMAGE}:${{ github.sha }}" | ||
if [[ $GITHUB_REF == ref/head/master ]]; then | ||
TAGS="${TAGS},${IMAGE}:latest" | ||
fi | ||
echo ::set-output name=tags::${TAGS,,} | ||
- name: Showtag | ||
id: showtag | ||
run: echo ${{ steps.prep.outputs.tags }} | ||
|
||
- name: Docker Buildx setup | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login in to registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: 🛠 Build & Publish Image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
# push: true # TODO: follow up on this... https://github.community/t/403-error-on-container-registry-push-from-github-action/173071/5 | ||
file: docker/eden-box.Dockerfile | ||
tags: ${{ steps.prep.outputs.tags }} |
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,27 @@ | ||
name: job-dev-gc | ||
on: | ||
schedule: | ||
- cron: "0 0,6,12,18 * * *" | ||
workflow_dispatch: | ||
inputs: | ||
reason: | ||
description: "What is the reason for triggering it manually?" | ||
required: true | ||
limit: | ||
description: "Limit Records to Collect" | ||
required: false | ||
default: 250 | ||
|
||
jobs: | ||
cron: | ||
runs-on: ubuntu-latest | ||
container: curlimages/curl:latest | ||
|
||
steps: | ||
- name: GC Job | ||
run: | | ||
curl -i --fail-with-body --request POST \ | ||
--url 'https://eden-dev.vercel.app/api/jobs/gc' \ | ||
--header 'Content-Type: application/json' \ | ||
--header 'x-job-key: ${{ secrets.DEV_JOBS_AUTH_GC }}' \ | ||
-d '{"limit": ${{ github.event.inputs.limit || 250 }}}' |
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,20 @@ | ||
name: job-dev-test | ||
on: | ||
schedule: | ||
- cron: "0 * * * *" # every hour | ||
workflow_dispatch: | ||
inputs: | ||
reason: | ||
description: "What is the reason for triggering it manually?" | ||
required: true | ||
jobs: | ||
cron: | ||
runs-on: ubuntu-latest | ||
container: curlimages/curl:latest | ||
|
||
steps: | ||
- name: Test Job | ||
run: | | ||
curl -i --fail-with-body --request POST \ | ||
--url 'https://eden-dev.vercel.app/api/jobs/test' \ | ||
--header 'x-job-key: ${{ secrets.DEV_JOBS_AUTH_GC }}' |
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,27 @@ | ||
name: job-prd-gc | ||
on: | ||
schedule: | ||
- cron: "0 0,6,12,18 * * *" | ||
workflow_dispatch: | ||
inputs: | ||
reason: | ||
description: "What is the reason for triggering it manually?" | ||
required: true | ||
limit: | ||
description: "Limit Records to Collect" | ||
required: false | ||
default: 250 | ||
|
||
jobs: | ||
cron: | ||
runs-on: ubuntu-latest | ||
container: curlimages/curl:latest | ||
|
||
steps: | ||
- name: GC Job | ||
run: | | ||
curl -i --fail-with-body --request POST \ | ||
--url 'https://eden-prod.vercel.app/api/jobs/gc' \ | ||
--header 'Content-Type: application/json' \ | ||
--header 'x-job-key: ${{ secrets.PRD_JOBS_AUTH_GC }}' \ | ||
-d '{"limit": ${{ github.event.inputs.limit || 250 }}}' |
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
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
add_subdirectory(eden) | ||
add_subdirectory(token) | ||
add_subdirectory(boot) | ||
add_subdirectory(bios) |
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 @@ | ||
add_executable(bios src/bios.cpp) | ||
target_include_directories(bios PUBLIC include) | ||
target_link_libraries(bios eosio-contract-simple-malloc) | ||
set_target_properties(bios PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${ROOT_BINARY_DIR}) |
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,32 @@ | ||
#pragma once | ||
|
||
#include <eosio/contract.hpp> | ||
#include <eosio/dispatcher.hpp> | ||
#include <eosio/privileged.hpp> | ||
|
||
namespace bios | ||
{ | ||
class bios_contract : public eosio::contract | ||
{ | ||
public: | ||
using eosio::contract::contract; | ||
void newaccount() {} | ||
void updateauth() {} | ||
void deleteauth() {} | ||
void linkauth() {} | ||
void setcode() {} | ||
void setabi() {} | ||
void canceldelay() {} | ||
void setpriv(eosio::name account, bool is_priv) { eosio::set_privileged(account, is_priv); } | ||
}; | ||
EOSIO_ACTIONS(bios_contract, | ||
"eosio"_n, | ||
newaccount, | ||
updateauth, | ||
deleteauth, | ||
linkauth, | ||
setcode, | ||
setabi, | ||
canceldelay, | ||
setpriv) | ||
} // namespace bios |
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,3 @@ | ||
#include <bios/bios.hpp> | ||
|
||
EOSIO_ACTION_DISPATCHER(bios::actions) |
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 @@ | ||
add_executable(boot src/boot.cpp) | ||
target_include_directories(boot PUBLIC include) | ||
target_link_libraries(boot eosio-contract-simple-malloc) | ||
set_target_properties(boot PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${ROOT_BINARY_DIR}) |
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,17 @@ | ||
#pragma once | ||
|
||
#include <eosio/contract.hpp> | ||
#include <eosio/dispatcher.hpp> | ||
#include <eosio/privileged.hpp> | ||
|
||
namespace boot | ||
{ | ||
class boot_contract : public eosio::contract | ||
{ | ||
public: | ||
using contract::contract; | ||
void boot(); | ||
void setcode() {} | ||
}; | ||
EOSIO_ACTIONS(boot_contract, "eosio"_n, boot, setcode) | ||
} // namespace boot |
Oops, something went wrong.