Skip to content

Commit

Permalink
chore: resolved conflicts from beta
Browse files Browse the repository at this point in the history
  • Loading branch information
mgordel committed Nov 28, 2023
2 parents ce5c884 + 627e370 commit ce70cbb
Show file tree
Hide file tree
Showing 87 changed files with 2,403 additions and 2,533 deletions.
3 changes: 2 additions & 1 deletion .docs/typedoc-frontmatter-theme.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class ModifiedHugoTheme extends HugoTheme {
return (
"---\n" +
Object.entries(yamlVars)
.map(([key, value]) => `${key}: ${value}`)
.map(([key, value]) => `${key}: "${value}"`)

.join("\n") +
"\n---\n" +
contents
Expand Down
61 changes: 44 additions & 17 deletions .github/workflows/cypress-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,25 @@ name: Nightly Cypress Tests

on:
schedule:
# run this workflow every day at 1:20 AM UTC
- cron: "20 1 * * *"

# Allows triggering the workflow manually
workflow_dispatch:
inputs:
provider_version:
description: "Provider version (e.g., v0.12.3 or pre-rel-v0.13.1)"
required: false
default: "v0.12.3"
requestor_version:
description: "Requestor version (e.g., v0.12.3 or pre-rel-v0.13.1)"
required: false
default: "v0.12.3"
provider_wasi_version:
description: "Provider WASI version (e.g., v0.2.2)"
required: false
default: "v0.2.2"
provider_vm_version:
description: "Provider VM version (e.g., v0.3.0)"
required: false
default: "v0.3.0"

jobs:
cypress-tests:
Expand All @@ -16,31 +30,43 @@ jobs:
uses: actions/checkout@v3

- name: Use random string for subnet
# Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2
run: echo "YAGNA_SUBNET=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')" >> $GITHUB_ENV

- name: Set up Versions
run: |
echo "PROVIDER_VERSION=${{ github.event.inputs.provider_version }}" >> $GITHUB_ENV
echo "REQUESTOR_VERSION=${{ github.event.inputs.requestor_version }}" >> $GITHUB_ENV
echo "PROVIDER_WASI_VERSION=${{ github.event.inputs.provider_wasi_version }}" >> $GITHUB_ENV
echo "PROVIDER_VM_VERSION=${{ github.event.inputs.provider_vm_version }}" >> $GITHUB_ENV
- name: Build the docker containers
run: docker compose -f tests/docker/docker-compose.yml build
run: |
docker compose -f tests/docker/docker-compose.yml build \
--build-arg UBUNTU_VERSION=22.04 \
--build-arg YA_CORE_PROVIDER_VERSION=${PROVIDER_VERSION} \
--build-arg YA_CORE_REQUESTOR_VERSION=${REQUESTOR_VERSION} \
--build-arg YA_WASI_VERSION=${PROVIDER_WASI_VERSION} \
--build-arg YA_VM_VERSION=${PROVIDER_VM_VERSION}
- name: Start the docker containers
# Restart docker to avoid issues with the docker compose down due to improper cleanup of the previous run.
run: sudo service docker restart && docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d
run: |
sudo service docker restart
docker compose -f tests/docker/docker-compose.yml down
docker compose -f tests/docker/docker-compose.yml up -d
- name: Fund the requestor
# Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry.
run: sleep 4 && docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"

- name: Install and build the SDK in the docker container
run: |
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build && ./node_modules/.bin/cypress install"
sleep 4
docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"
- name: Install and build the SDK
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build && ./node_modules/.bin/cypress install"

- name: Run web server
run: |
docker exec -t -d docker-requestor-1 /bin/sh -c "cd /golem-js/examples/web && node app.mjs"
run: docker exec -t -d docker-requestor-1 /bin/sh -c "cd /golem-js/examples/web && node app.mjs"

- name: Run test suite
run: |
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm run test:cypress -- --browser chromium"
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm run test:cypress -- --browser chromium"

- name: Upload test logs
uses: actions/upload-artifact@v2
Expand All @@ -52,5 +78,6 @@ jobs:
- name: Cleanup Docker
if: always()
run: |
c=$(docker ps -q) && [[ $c ]] && docker kill $c
c=$(docker ps -q)
[[ $c ]] && docker kill $c
docker system prune -af
50 changes: 34 additions & 16 deletions .github/workflows/examples-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,25 @@ name: Nightly Examples Tests

on:
schedule:
# run this workflow every day at 1:30 AM UTC
- cron: "30 1 * * *"

# Allows triggering the workflow manually
workflow_dispatch:
inputs:
provider_version:
description: "Provider version (e.g., v0.12.3 or pre-rel-v0.13.1)"
required: false
default: "v0.12.3"
requestor_version:
description: "Requestor version (e.g., v0.12.3 or pre-rel-v0.13.1)"
required: false
default: "v0.12.3"
provider_wasi_version:
description: "Provider WASI version (e.g., v0.2.2)"
required: false
default: "v0.2.2"
provider_vm_version:
description: "Provider VM version (e.g., v0.3.0)"
required: false
default: "v0.3.0"

jobs:
prepare-matrix-master-only:
Expand All @@ -19,43 +33,47 @@ jobs:
- name: Get matrix JSON
id: get-matrix
run: echo "::set-output name=matrix::{\"include\":[{\"branch\":\"master\"}]}"

goth-tests:
runs-on: goth2
needs: prepare-matrix-master-only
strategy:
matrix: ${{ fromJson(needs.prepare-matrix-master-only.outputs.matrix-json) }}
fail-fast: false
name: Run example tests (nightly) on ${{ matrix.branch }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use random string for subnet
# Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2
run: echo "YAGNA_SUBNET=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')" >> $GITHUB_ENV

- name: Set up Versions
run: |
echo "PROVIDER_VERSION=${{ github.event.inputs.provider_version }}" >> $GITHUB_ENV
echo "REQUESTOR_VERSION=${{ github.event.inputs.requestor_version }}" >> $GITHUB_ENV
echo "PROVIDER_WASI_VERSION=${{ github.event.inputs.provider_wasi_version }}" >> $GITHUB_ENV
echo "PROVIDER_VM_VERSION=${{ github.event.inputs.provider_vm_version }}" >> $GITHUB_ENV
- name: Build the docker containers
run: docker compose -f tests/docker/docker-compose.yml build
run: |
docker compose -f tests/docker/docker-compose.yml build \
--build-arg UBUNTU_VERSION=22.04 \
--build-arg YA_CORE_PROVIDER_VERSION=${PROVIDER_VERSION} \
--build-arg YA_CORE_REQUESTOR_VERSION=${REQUESTOR_VERSION} \
--build-arg YA_WASI_VERSION=${PROVIDER_WASI_VERSION} \
--build-arg YA_VM_VERSION=${PROVIDER_VM_VERSION}
- name: Start the docker containers
# Restart docker to avoid issues with the docker compose down due to improper cleanup of the previous run.
run: sudo service docker restart && docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d

- name: Fund the requestor
# Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry.
run: sleep 10 && docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"

- name: Install and build the SDK in the docker container
run: |
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build"
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build"

- name: Run the Examples tests
run: |
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm install --prefix examples && npm install ts-node && npm run test:examples -- --exitOnError"
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm install --prefix examples && npm install ts-node && npm run test:examples -- --exitOnError"

- name: Cleanup Docker
if: always()
run: |
c=$(docker ps -q) && [[ $c ]] && docker kill $c
docker system prune -af
run: docker ps -q | xargs -r docker kill && docker system prune -af
55 changes: 43 additions & 12 deletions .github/workflows/goth-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,25 @@ name: Nightly E2E Tests

on:
schedule:
# run this workflow every day at 1:00 AM UTC
- cron: "0 1 * * *"

# Allows triggering the workflow manually
workflow_dispatch:
inputs:
provider_version:
description: "Provider version (e.g., v0.12.3 or pre-rel-v0.13.1)"
required: false
default: "v0.12.3"
requestor_version:
description: "Requestor version (e.g., v0.12.3 or pre-rel-v0.13.1)"
required: false
default: "v0.12.3"
provider_wasi_version:
description: "Provider WASI version (e.g., v0.2.2)"
required: false
default: "v0.2.2"
provider_vm_version:
description: "Provider VM version (e.g., v0.3.0)"
required: false
default: "v0.3.0"

jobs:
prepare-matrix-master-only:
Expand All @@ -33,28 +47,45 @@ jobs:

- name: Use random string for subnet
# Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2

run: echo "YAGNA_SUBNET=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')" >> $GITHUB_ENV

- name: Set up Versions
run: |
echo "PROVIDER_VERSION=${{ github.event.inputs.provider_version }}" >> $GITHUB_ENV
echo "REQUESTOR_VERSION=${{ github.event.inputs.requestor_version }}" >> $GITHUB_ENV
echo "PROVIDER_WASI_VERSION=${{ github.event.inputs.provider_wasi_version }}" >> $GITHUB_ENV
echo "PROVIDER_VM_VERSION=${{ github.event.inputs.provider_vm_version }}" >> $GITHUB_ENV
- name: Build the docker containers
run: docker compose -f tests/docker/docker-compose.yml build
run: |
docker compose -f tests/docker/docker-compose.yml build \
--build-arg UBUNTU_VERSION=22.04 \
--build-arg YA_CORE_PROVIDER_VERSION=${PROVIDER_VERSION} \
--build-arg YA_CORE_REQUESTOR_VERSION=${REQUESTOR_VERSION} \
--build-arg YA_WASI_VERSION=${PROVIDER_WASI_VERSION} \
--build-arg YA_VM_VERSION=${PROVIDER_VM_VERSION}
- name: Start the docker containers
# Restart docker to avoid issues with the docker compose down due to improper cleanup of the previous run.
run: sudo service docker restart && docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d
run: |
sudo service docker restart
docker compose -f tests/docker/docker-compose.yml down
docker compose -f tests/docker/docker-compose.yml up -d
- name: Fund the requestor
# Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry.
run: sleep 10 && docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"

- name: Install and build the SDK in the docker container
run: |
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build"
sleep 10
docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"
- name: Install and build the SDK
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build"

- name: Start the e2e test
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run test:e2e"

- name: Cleanup Docker
if: always()
run: |
c=$(docker ps -q) && [[ $c ]] && docker kill $c
c=$(docker ps -q)
[[ $c ]] && docker kill $c
docker system prune -af
46 changes: 40 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@ on:

# Allows triggering the workflow manually
workflow_dispatch:
inputs:
provider_version:
description: "Provider version (e.g., v0.12.3 or pre-rel-v0.13.1)"
required: false
default: "v0.12.3"
requestor_version:
description: "Requestor version (e.g., v0.12.3 or pre-rel-v0.13.1)"
required: false
default: "v0.12.3"
provider_wasi_version:
description: "Provider WASI version (e.g., v0.2.2)"
required: false
default: "v0.2.2"
provider_vm_version:
description: "Provider VM version (e.g., v0.3.0)"
required: false
default: "v0.3.0"

# We're going to interact with GH from the pipelines, so we need to get some permissions
permissions:
Expand Down Expand Up @@ -58,16 +75,32 @@ jobs:
# Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2
run: echo "YAGNA_SUBNET=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')" >> $GITHUB_ENV

- name: Set up Versions
run: |
echo "PROVIDER_VERSION=${{ github.event.inputs.provider_version }}" >> $GITHUB_ENV
echo "REQUESTOR_VERSION=${{ github.event.inputs.requestor_version }}" >> $GITHUB_ENV
echo "PROVIDER_WASI_VERSION=${{ github.event.inputs.provider_wasi_version }}" >> $GITHUB_ENV
echo "PROVIDER_VM_VERSION=${{ github.event.inputs.provider_vm_version }}" >> $GITHUB_ENV
- name: Build the docker containers
run: docker compose -f tests/docker/docker-compose.yml build
run: |
docker compose -f tests/docker/docker-compose.yml build \
--build-arg UBUNTU_VERSION=22.04 \
--build-arg YA_CORE_PROVIDER_VERSION=${PROVIDER_VERSION} \
--build-arg YA_CORE_REQUESTOR_VERSION=${REQUESTOR_VERSION} \
--build-arg YA_WASI_VERSION=${PROVIDER_WASI_VERSION} \
--build-arg YA_VM_VERSION=${PROVIDER_VM_VERSION}
- name: Start the docker containers
# Restart docker to avoid issues with the docker compose down due to improper cleanup of the previous run.
run: sudo service docker restart && docker compose -f tests/docker/docker-compose.yml down && docker compose -f tests/docker/docker-compose.yml up -d
run: |
sudo service docker restart
docker compose -f tests/docker/docker-compose.yml down
docker compose -f tests/docker/docker-compose.yml up -d
- name: Fund the requestor
# Use a funding script which will retry funding the requestor 3 times, else it exits with error. The faucet is not reliable and sometimes fails to fund the requestor, thus the retry.
run: sleep 4 && docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"
run: |
sleep 10
docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"
- name: Install and build the SDK in the docker container
run: |
Expand Down Expand Up @@ -99,7 +132,8 @@ jobs:
- name: Cleanup Docker
if: always()
run: |
c=$(docker ps -q) && [[ $c ]] && docker kill $c
c=$(docker ps -q)
[[ $c ]] && docker kill $c
docker system prune -af
release:
Expand Down
Loading

0 comments on commit ce70cbb

Please sign in to comment.