From 8bdd9bc46a4fa5afb4a595a5df591c5afacf81a5 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Wed, 29 Mar 2023 12:36:42 -0500 Subject: [PATCH 1/3] Gitea actions. --- .gitea/workflows/publish.yaml | 32 ++++++++++++++ .gitea/workflows/test.yml | 79 +++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 .gitea/workflows/publish.yaml create mode 100644 .gitea/workflows/test.yml diff --git a/.gitea/workflows/publish.yaml b/.gitea/workflows/publish.yaml new file mode 100644 index 0000000..51b9c53 --- /dev/null +++ b/.gitea/workflows/publish.yaml @@ -0,0 +1,32 @@ +name: Publish npm package to gitea +on: + release: + types: [published] +jobs: + npm_publish: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [ 16.x ] + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: yarn + - name: Run yarn build + run: | + yarn build + - name: Configure git.vdb.to npm registry + run: | + npm config set registry https://git.vdb.to/api/packages/cerc-io/npm/ + - name: Authenticate to git.vdb.to registry + run: | + npm config set -- '//git.vdb.to/api/packages/cerc-io/npm/:_authToken' "${{ secrets.GITEA_PUBLISH_TOKEN }}" + - name: npm publish + run: | + npm publish diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..74cece8 --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,79 @@ +name: Tests +on: + pull_request: + push: + branches: + - main + - release/** + +env: + DOCKER_HOST: /var/run/dind.sock + +jobs: + sdk_tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Checkout laconicd + uses: actions/checkout@v3 + with: + path: "./laconicd/" + repository: cerc-io/laconicd + fetch-depth: 0 + ref: main + - name: Environment + run: ls -tlh && env + - name: Start dockerd + run: | + dockerd -H unix:///var/run/docker.ci.sock --userland-proxy=false & + sleep 5 + - name: build containers scripts + working-directory: laconicd/tests/sdk_tests + run: ./build-laconicd-container.sh + - name: build test-container + run: docker build -t cerc-io/laconic-sdk-tester:local-test -f laconicd/tests/sdk_tests/Dockerfile-sdk . + - name: start containers + working-directory: laconicd/tests/sdk_tests + run: docker compose up -d + - name: run basic tests + working-directory: laconicd/tests/sdk_tests + run: | + laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe ) + cosmos_chain_id=laconic_9000-1 + laconicd_rest_endpoint=http://laconicd:1317 + laconicd_gql_endpoint=http://laconicd:9473/api + sleep 30s + docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test" + - name: stop containers + working-directory: laconicd/tests/sdk_tests + run: docker compose down + - name: start auction containers + working-directory: laconicd/tests/sdk_tests + run: docker compose -f docker-compose-auctions.yml up -d + - name: run auction tests + working-directory: laconicd/tests/sdk_tests + run: | + laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe ) + cosmos_chain_id=laconic_9000-1 + laconicd_rest_endpoint=http://laconicd:1317 + laconicd_gql_endpoint=http://laconicd:9473/api + sleep 30s + docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test:auctions" + - name: start containers + working-directory: laconicd/tests/sdk_tests + run: docker compose down + - name: start containers + working-directory: laconicd/tests/sdk_tests + run: docker compose -f docker-compose-nameservice.yml up -d + - name: run nameservice expiry tests + working-directory: laconicd/tests/sdk_tests + run: | + laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe ) + cosmos_chain_id=laconic_9000-1 + laconicd_rest_endpoint=http://laconicd:1317 + laconicd_gql_endpoint=http://laconicd:9473/api + sleep 30s + docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test:nameservice-expiry" + - name: stop nameservice containers + working-directory: laconicd/tests/sdk_tests + run: docker compose down -- 2.45.2 From 4898d8e00ccee7fa45a65a80117ad96ff4131ba9 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Wed, 29 Mar 2023 15:26:42 -0500 Subject: [PATCH 2/3] Tweak for gitea --- .gitea/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 74cece8..0234ccf 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -1,6 +1,8 @@ name: Tests on: pull_request: + branches: + - * push: branches: - main -- 2.45.2 From f8a10bf99317a4a0c153b117e636b73c465a8762 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Wed, 29 Mar 2023 15:29:09 -0500 Subject: [PATCH 3/3] Tweak for gitea --- .gitea/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 0234ccf..202569f 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -2,7 +2,7 @@ name: Tests on: pull_request: branches: - - * + - '*' push: branches: - main -- 2.45.2