Skip to content

Commit

Permalink
Merge pull request #1013 from golemfactory/beta
Browse files Browse the repository at this point in the history
Release 3.0-beta to master
  • Loading branch information
grisha87 authored Jul 1, 2024
2 parents ed9af29 + 013be2d commit 2202b19
Show file tree
Hide file tree
Showing 453 changed files with 24,718 additions and 43,171 deletions.
2 changes: 1 addition & 1 deletion .github/actions/cleanup-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runs:
docker compose -f tests/docker/docker-compose.yml logs requestor > log-output/${{inputs.type}}-requestor.log
- name: Upload provider output and logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{inputs.type}}-golem-provider-and-requestor-logs
Expand Down
18 changes: 17 additions & 1 deletion .github/actions/prepare-tests/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: "Prepare providers and requestor"
description: "Prepare providers and requestor"
inputs:
type:
description: "Type of test"
required: true
default: "test"
runs:
using: "composite"
steps:
Expand All @@ -11,6 +16,7 @@ runs:
- name: Set up Versions
shell: bash
run: |
echo "PAYMENT_NETWORK=${PAYMENT_NETWORK}" >> $GITHUB_ENV
echo "PROVIDER_VERSION=${PROVIDER_VERSION}" >> $GITHUB_ENV
echo "REQUESTOR_VERSION=${REQUESTOR_VERSION}" >> $GITHUB_ENV
echo "PROVIDER_WASI_VERSION=${PROVIDER_WASI_VERSION}" >> $GITHUB_ENV
Expand All @@ -37,9 +43,19 @@ runs:
shell: bash
run: |
sleep 10
echo "Going to fund the requestor"
docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh"
echo "Successfully funded the requestor"
- name: Install and build the SDK in the docker container
shell: bash
run: |
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build && ./node_modules/.bin/cypress install && npm install --prefix examples && npm install ts-node"
echo "Going to build the SDK on the requestor"
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build"
echo "Successfully built the SDK on the requestor"
- name: Install Cypress
if: ${{ inputs.type == 'cypress' }}
shell: bash
run: |
docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && ./node_modules/.bin/cypress install"
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup NodeJS ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -44,3 +44,4 @@ jobs:
npm run build
npm install --prefix examples
npm run --prefix examples lint:ts
npm run test:import
93 changes: 56 additions & 37 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ on:
# Allows triggering the workflow manually
workflow_dispatch:
inputs:
payment_network:
description: "Payment network (holesky, goerli, mainnet, mumbai, polygon, rinkeby)"
required: false
default: "holesky"
provider_version:
description: "Provider version (e.g., v0.14.0 or pre-rel-v0.14.1)"
description: "Provider version (e.g., v0.15.0 or pre-rel-v0.15.1)"
required: false
default: "v0.14.0"
default: "v0.15.2"
requestor_version:
description: "Requestor version (e.g., v0.14.0 or pre-rel-v0.14.1)"
description: "Requestor version (e.g., v0.15.0 or pre-rel-v0.15.1)"
required: false
default: "v0.14.0"
default: "v0.15.2"
provider_wasi_version:
description: "Provider WASI version (e.g., v0.2.2)"
required: false
Expand All @@ -36,10 +40,11 @@ permissions:
contents: read # for checkout

env:
PROVIDER_VERSION: ${{ github.event.inputs.provider_version || 'v0.14.0' }}
REQUESTOR_VERSION: ${{ github.event.inputs.requestor_version || 'v0.14.0' }}
PROVIDER_VERSION: ${{ github.event.inputs.provider_version || 'v0.15.2' }}
REQUESTOR_VERSION: ${{ github.event.inputs.requestor_version || 'v0.15.2' }}
PROVIDER_WASI_VERSION: ${{ github.event.inputs.provider_wasi_version || 'v0.2.2' }}
PROVIDER_VM_VERSION: ${{ github.event.inputs.provider_vm_version || 'v0.3.0' }}
PAYMENT_NETWORK: ${{ github.event.inputs.payment_network || 'holesky' }}

jobs:
regular-checks:
Expand All @@ -55,10 +60,10 @@ jobs:
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup NodeJS ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -71,20 +76,21 @@ jobs:
npm run build
npm install --prefix examples
npm run --prefix examples lint:ts
npm run test:import
- name: Upload unit test reports
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: unit-test-report
name: unit-test-report-${{matrix.os}}-node-${{matrix.node-version}}
path: reports/unit-report.xml

run-e2e-tests:
name: Run E2E tests
needs: regular-checks
runs-on: goth2
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Prepare providers and requestor
uses: ./.github/actions/prepare-tests
Expand All @@ -93,35 +99,57 @@ jobs:
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm run test:e2e"

- name: Upload E2E reports
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-test-report
path: reports/e2e-report.xml

- name: Cleanup test environment
uses: ./.github/actions/cleanup-tests
if: always()
with:
type: "e2e"

run-examples-tests:
name: Run Examples tests
needs: regular-checks
runs-on: goth2
steps:
- uses: actions/checkout@v4

- name: Prepare providers and requestor
uses: ./.github/actions/prepare-tests

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

- name: Cleanup test environment
uses: ./.github/actions/cleanup-tests
if: always()
with:
type: "examples"

run-cypress-tests:
name: Run Cypress tests
needs: regular-checks
runs-on: goth2
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Prepare providers and requestor
uses: ./.github/actions/prepare-tests
with:
type: "cypress"

- 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 && npm run web"

- name: Run test suite
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@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-logs
Expand All @@ -132,27 +160,9 @@ jobs:
with:
type: "cypress"

run-examples-tests:
name: Run Examples tests
needs: regular-checks
runs-on: goth2
steps:
- uses: actions/checkout@v3

- name: Prepare providers and requestor
uses: ./.github/actions/prepare-tests

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

- name: Cleanup test environment
uses: ./.github/actions/cleanup-tests
with:
type: "examples"

release:
name: Release the SDK to NPM and GitHub
needs: [run-e2e-tests, run-cypress-tests, run-examples-tests]
needs: [run-e2e-tests, run-examples-tests, run-cypress-tests]
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
Expand All @@ -161,16 +171,25 @@ jobs:
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup NodeJS
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
# Semantic release requires this as bare minimum
node-version: 20

# Why this? https://github.com/npm/cli/issues/7279
# Why this way? https://github.com/actions/setup-node/issues/213
- name: Install latest npm
shell: bash
run: |
npm install -g npm@latest &&
npm --version &&
npm list -g --depth 0
- name: Install dependencies
run: npm install

Expand All @@ -185,4 +204,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
run-name: "${{ github.workflow }} - Requestor: ${{ github.event.inputs.requestor_version }}, Provider: ${{ github.event.inputs.provider_version }}, WASI: ${{ github.event.inputs.provider_wasi_version }}, VM: ${{ github.event.inputs.provider_vm_version }}"
run-name: "${{ github.workflow }} - Network: ${{ github.event.inputs.payment_network }}, Requestor: ${{ github.event.inputs.requestor_version }}, Provider: ${{ github.event.inputs.provider_version }}, WASI: ${{ github.event.inputs.provider_wasi_version }}, VM: ${{ github.event.inputs.provider_vm_version }}"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ coverage/
/examples/yacat/*.txt
/examples/yacat/*.hash
/examples/yacat/*.potfile
/docs
api-reference/
logs/
.cypress

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function prepareDocAnchor(docsDir, type, file) {
}

(async () => {
const docsDir = process.argv[2] || "docs";
const docsDir = process.argv[2] || "api-reference";
const directoryPath = path.join(__dirname, "..", docsDir);
const logFilePath = path.join(process.argv[3] || docsDir, "overview.md");
const logStream = fs.createWriteStream(logFilePath, { flags: "w" });
Expand Down
File renamed without changes.
Loading

0 comments on commit 2202b19

Please sign in to comment.