Skip to content
Snippets Groups Projects
Select Git revision
  • 3d3b99bbbfd28d73709c41647793782df5efdd7f
  • release default
  • 11-22-implement-kv-interface-defined-in-collectiveversionedkvgo
  • master protected
  • XX-4688/DbEncoding
  • hotfix/update
  • @XX-4682/Files
  • hotfix/XX-4655
  • dev protected
  • project/HavenNotifications
  • XX-4602/SilentMessageType
  • jono/npmTest
  • wasmTest2
  • XX-4461/FileUpload
  • XX-4505/blockuser
  • XX-4441
  • Jakub/Emoji-CI-Test
  • testing/websockets
  • fastReg
  • fast-registration
  • NewHostPool
  • v0.3.22
  • v0.3.21
  • v0.3.20
  • v0.3.18
  • v0.3.17
  • v0.3.16
  • v0.3.15
  • v0.3.14
  • v0.3.13
  • v0.3.12
  • v0.3.11
  • v0.3.10
  • v0.3.9
  • v0.3.8
  • v0.3.7
  • v0.3.6
  • v0.3.5
  • v0.3.4
  • 812b395df518ce096d01d5292596ca26f8fe92d9c4487ddfa515e190a51aa1a1
  • 76ba08e2dfa1798412a265404fa271840b52c035869111fce8e8cdb23a036a5a
41 results

tsconfig.json

Blame
  • .gitlab-ci.yml 3.41 KiB
    image: docker-registry.xx.network/elixxir/sysadmin/backend-ci:go1.21-cuda11.1.1
    
    before_script:
      - go version || echo "Go executable not found."
      - echo $CI_BUILD_REF
      - echo $CI_PROJECT_DIR
      - echo $PWD
      - eval $(ssh-agent -s)
      - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
      - mkdir -p ~/.ssh
      - chmod 700 ~/.ssh
      - ssh-keyscan -t rsa $GITLAB_SERVER > ~/.ssh/known_hosts
      - rm -rf ~/.gitconfig
      - git config --global url."git@$GITLAB_SERVER:".insteadOf "https://gitlab.com/"
      - git config --global url."git@$GITLAB_SERVER:".insteadOf "https://git.xx.network/" --add
      - export PATH=$HOME/go/bin:$PATH
      - export GOPATH=$HOME/go/bin
      - echo $DOCKER_IMAGE
    
    stages:
      - test
      - build
      - npm
      - doc-update
    
    go-test:
      stage: test
      script:
        - go mod vendor -v
        - go test ./... -v
    
    wasm-test:
      stage: test
      script:
        - export PATH=/root/go/bin:$PATH
        - go mod vendor
        - unset SSH_PRIVATE_KEY
        - unset $(env | grep '=' | awk -F= '{print $1}' | grep -v PATH | grep -v GO | grep -v HOME)
        # - rm vendor/gitlab.com/elixxir/wasm-utils/exception/throw_js.s
        # - mv vendor/gitlab.com/elixxir/wasm-utils/exception/throws.dev vendor/gitlab.com/elixxir/wasm-utils/exception/throws.go
        # - GOOS=js GOARCH=wasm go test ./... -v
        - make tests
    
    build:
      stage: build
      script:
        - go mod vendor -v
        - mkdir -p release
        # Main library
        - GOOS=js GOARCH=wasm go build -ldflags '-w -s' -trimpath -o release/xxdk.wasm main.go
        # Workers
        - GOOS=js GOARCH=wasm go build -ldflags '-w -s' -trimpath -o release/xxdk-channelsIndexedDbWorker.wasm ./indexedDb/impl/channels/...
        - GOOS=js GOARCH=wasm go build -ldflags '-w -s' -trimpath -o release/xxdk-dmIndexedDbWorker.wasm ./indexedDb/impl/dm/...
        - GOOS=js GOARCH=wasm go build -ldflags '-w -s' -trimpath -o release/xxdk-logFileWorker.wasm ./logging/workerThread/...
        - GOOS=js GOARCH=wasm go build -ldflags '-w -s' -trimpath -o release/xxdk-stateIndexedDbWorker.wasm ./indexedDb/impl/state/...
        - cp assets/jsutils/* release/
        # Wasm executor
        - cp wasm_exec.js release/
      artifacts:
        paths:
          - release/
        expose_as: "release"
    
    s3upload:
      stage: npm
      only:
        - tags
      script:
        - mc --version
        - mkdir -p npm_release
        - npm i
        - npm run build
        - npm pack --pack-destination npm_release/
        - cd npm_release && tar -xzvf *.tgz && cd ..
        # Upload to S3
        - mc alias set elixxir-s3 $ARTIFACT_S3_ENDPOINT $ARTIFACT_S3_KEY $ARTIFACT_S3_SECRET
        - mc cp --recursive --md5 npm_release/package/ elixxir-s3/$ARTIFACT_S3_BUCKET/wasm/xxdk-wasm-0.3.14/
      artifacts:
        paths:
          - npm_release
    
    # This pipeline job will attempt to have pkg.go.dev update docs for xxdk-wasm.
    #
    # pkg.go.dev relies on the proxy.golang.org service (go module cache/proxy) to
    # discover versions of Go modules to make docs of. The proxy keeps a list of all
    # known versions of Go modules. The go mod proxy does cache pulls for about 30
    # minutes, so if quickly successive commits are done in master/release, this
    # will fail to pull the latest client, and the docs will not update.
    doc-update:
      stage: doc-update
      only:
        - tags
      script:
        # GOPRIVATE is cleared so that the public cache is pulled instead of directly pulling client.
        - NEXT_WAIT_TIME=0; until [ $NEXT_WAIT_TIME -eq 15 ] || GOOS=js GOARCH=wasm GOPRIVATE="" go install gitlab.com/elixxir/xxdk-wasm@$CI_COMMIT_TAG; do sleep 60; (( NEXT_WAIT_TIME+=1 )); done; [ $NEXT_WAIT_TIME -lt 15 ]