Skip to content

Commit 415394c

Browse files
committed
Merge branch 'main' into address-length
2 parents 1a5bcee + d71b1db commit 415394c

File tree

133 files changed

+889
-1745
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+889
-1745
lines changed

.circleci/config.yml

Lines changed: 0 additions & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,12 @@ workflows:
1414
matrix:
1515
parameters:
1616
simapp: ["simapp47", "simapp50"]
17-
- test-node:
18-
requires:
19-
- build
20-
matrix:
21-
parameters:
22-
node-version: ["18", "20"]
2317
- test-chrome:
2418
requires:
2519
- build
2620
- coverage:
2721
requires:
2822
- build
29-
- faucet-docker
3023

3124
jobs:
3225
build:
@@ -186,142 +179,6 @@ jobs:
186179
./scripts/<< parameters.simapp >>/stop.sh
187180
./scripts/<< parameters.simapp >>/slow_stop.sh
188181
./scripts/wasmd/stop.sh
189-
test-node:
190-
parameters:
191-
node-version:
192-
type: string
193-
machine:
194-
# We can't use a containerized environment since it requires remote docker to start custom containers.
195-
# However, we can't access the remote docker's network from the primary container. This is a
196-
# feature, as documented in https://circleci.com/docs/2.0/building-docker-images/#separation-of-environments
197-
# As a consequence, we cannot use the circleci CLI for this job because "You cannot use the machine
198-
# executor in local jobs." (https://circleci.com/docs/2.0/local-cli/#limitations-of-running-jobs-locally)
199-
#
200-
# Available images: https://circleci.com/developer/machine/image/ubuntu-2004
201-
# Note that ubuntu-2004:202111-02 and above cause checksum issues when installing yarn packages. No idea why.
202-
image: ubuntu-2004:202111-02
203-
resource_class: large
204-
steps:
205-
- run:
206-
name: Install Git Large File Storage (LFS)
207-
# In the current image, `sudo apt install git-lfs` requires `sudo apt update` which is too slow
208-
command: |
209-
wget -O "$HOME/git-lfs.deb" https://packagecloud.io/github/git-lfs/packages/ubuntu/focal/git-lfs_2.13.3_amd64.deb/download.deb
210-
sudo dpkg -i "$HOME/git-lfs.deb"
211-
- checkout
212-
- run: # start early for less wait time below
213-
name: Start wasmd
214-
command: ./scripts/wasmd/start.sh
215-
background: true
216-
- run:
217-
name: Start simapp
218-
command: ./scripts/simapp50/start.sh
219-
background: true
220-
- run:
221-
name: Start slow simapp
222-
command: ./scripts/simapp50/slow_start.sh
223-
background: true
224-
- run:
225-
name: Start Tendermint blockchains
226-
command: ./scripts/tendermint/all_start.sh
227-
background: true
228-
- attach_workspace:
229-
at: /tmp/builds
230-
- run:
231-
name: Merge build folders into project (merge with hardlinks)
232-
command: cp --recursive --link /tmp/builds/* .
233-
- run:
234-
# The images comes with preinstalled nvm, which does not work well with non-login shells
235-
name: Uninstall nvm
236-
# Moving to trash is faster than deleting (gvfs-trash is not installed on this image)
237-
command: |
238-
nvm --version && nvm ls
239-
mkdir -p ~/.local/share/Trash && mv "$NVM_DIR" ~/.npm ~/.local/share/Trash
240-
- run:
241-
name: Install nodejs
242-
# In the current image, `sudo apt install nodejs` requires `sudo apt update` which is too slow.
243-
# Follow instructions of https://deb.nodesource.com/ except the last step. Then run
244-
# `apt download --print-uris nodejs` to get a download URL.
245-
command: |
246-
declare -A node_links=(
247-
["18"]="https://deb.nodesource.com/node_18.x/pool/main/n/nodejs/nodejs_18.17.1-1nodesource1_amd64.deb"
248-
["20"]="https://deb.nodesource.com/node_20.x/pool/main/n/nodejs/nodejs_20.6.0-1nodesource1_amd64.deb"
249-
)
250-
wget -O "$HOME/nodejs.deb" "${node_links[<< parameters.node-version >>]}"
251-
sudo dpkg -i "$HOME/nodejs.deb"
252-
- run:
253-
name: Install yarn
254-
command: |
255-
wget -O "$HOME/yarn.deb" https://dl.yarnpkg.com/debian/pool/main/y/yarn/yarn_1.22.15_all.deb
256-
sudo dpkg -i "$HOME/yarn.deb"
257-
- run:
258-
name: Version information
259-
command: echo "node $(node --version)"; echo "yarn $(yarn --version)"
260-
- run:
261-
name: Install libusb
262-
# In the current image, `sudo apt install libusb-1.0-0-dev` requires `sudo apt update` which is too slow
263-
command: |
264-
wget -O "$HOME/libusb.deb" http://de.archive.ubuntu.com/ubuntu/pool/main/libu/libusb-1.0/libusb-1.0-0-dev_1.0.23-2build1_amd64.deb
265-
sudo dpkg -i "$HOME/libusb.deb"
266-
- run:
267-
name: Install libudev-dev
268-
# See https://packages.ubuntu.com/focal/libudev-dev (Ubuntu 20.04)
269-
command: |
270-
wget -O "$HOME/libudev1.deb" http://security.ubuntu.com/ubuntu/pool/main/s/systemd/libudev1_245.4-4ubuntu3.20_amd64.deb
271-
wget -O "$HOME/libudev-dev.deb" http://security.ubuntu.com/ubuntu/pool/main/s/systemd/libudev-dev_245.4-4ubuntu3.20_amd64.deb
272-
sudo dpkg -i "$HOME/libudev1.deb"
273-
sudo dpkg -i "$HOME/libudev-dev.deb"
274-
- run:
275-
name: Install Dependencies
276-
command: yarn install --immutable --immutable-cache --check-cache
277-
- run:
278-
name: Initialize wasmd (deploy contracts and friends)
279-
command: ./scripts/wasmd/init.sh
280-
- run:
281-
name: Start socket server
282-
command: ./scripts/socketserver/start.sh
283-
- run:
284-
name: Start http server
285-
command: ./scripts/httpserver/start.sh
286-
- run:
287-
environment:
288-
HTTPSERVER_ENABLED: 1
289-
SIMAPP50_ENABLED: 1
290-
SLOW_SIMAPP50_ENABLED: 1
291-
TENDERMINT_ENABLED: 1
292-
SOCKETSERVER_ENABLED: 1
293-
SKIP_BUILD: 1
294-
WASMD_ENABLED: 1
295-
# Stopped working for Node.js 20. Maybe we need to upgrade the dependency or something.
296-
# SES_ENABLED: 1
297-
command: yarn test --stream
298-
- run:
299-
name: Run CLI selftest
300-
working_directory: packages/cli
301-
environment:
302-
SKIP_BUILD: 1
303-
command: yarn selftest
304-
- run:
305-
name: Run CLI examples
306-
working_directory: packages/cli
307-
environment:
308-
HTTPSERVER_ENABLED: 1
309-
SIMAPP50_ENABLED: 1
310-
SLOW_SIMAPP50_ENABLED: 1
311-
TENDERMINT_ENABLED: 1
312-
SOCKETSERVER_ENABLED: 1
313-
SKIP_BUILD: 1
314-
WASMD_ENABLED: 1
315-
command: ./run_examples.sh
316-
- run:
317-
name: Stop chains
318-
command: |
319-
./scripts/httpserver/stop.sh
320-
./scripts/socketserver/stop.sh
321-
./scripts/tendermint/all_stop.sh
322-
./scripts/simapp50/stop.sh
323-
./scripts/simapp50/slow_stop.sh
324-
./scripts/wasmd/stop.sh
325182
test-chrome:
326183
machine:
327184
# We can't use a containerized environment since it requires remote docker to start custom containers.
@@ -544,31 +401,3 @@ jobs:
544401
./scripts/simapp50/stop.sh
545402
./scripts/simapp50/slow_stop.sh
546403
./scripts/wasmd/stop.sh
547-
faucet-docker:
548-
docker:
549-
- image: cimg/go:1.17.8
550-
steps:
551-
- run:
552-
name: Install Git Large File Storage (LFS)
553-
command: |
554-
sudo apt update
555-
sudo apt install git-lfs
556-
- checkout
557-
- setup_remote_docker:
558-
version: default
559-
- run:
560-
name: Build faucet Docker image
561-
# Use ${CIRCLE_TAG}
562-
command: |
563-
docker build --pull -t "confio/faucet:$CIRCLE_SHA1" -f packages/faucet/Dockerfile .
564-
- run:
565-
name: Check docker image can be executed
566-
command: |
567-
docker run --rm "confio/faucet:$CIRCLE_SHA1" version
568-
docker run --rm "confio/faucet:$CIRCLE_SHA1" generate
569-
# - run:
570-
# name: Push image to Docker Hub
571-
# command: |
572-
# docker login --password-stdin -u "$DOCKER_USER" \<<<"$DOCKER_PASS"
573-
# docker push "confio/faucet:$CIRCLE_SHA1"
574-
# docker logout

.github/workflows/faucet.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Create and publish faucet Docker image
2+
3+
on:
4+
push:
5+
branches: ["main", "publish-docker-gh"]
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: cosmos/cosmjs-faucet
10+
11+
jobs:
12+
build-and-push-image:
13+
runs-on: ubuntu-latest
14+
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
15+
permissions:
16+
contents: read
17+
packages: write
18+
attestations: write
19+
id-token: write
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
with:
24+
lfs: true
25+
26+
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
27+
- name: Log in to the Container registry
28+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
29+
with:
30+
registry: ${{ env.REGISTRY }}
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
35+
- name: Extract metadata (tags, labels) for Docker
36+
id: meta
37+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
38+
with:
39+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
40+
41+
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
42+
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see [Usage](https://github.com/docker/build-push-action#usage) in the README of the `docker/build-push-action` repository.
43+
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
44+
- name: Build and push Docker image
45+
id: push
46+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
47+
with:
48+
context: .
49+
file: packages/faucet/Dockerfile
50+
push: true
51+
tags: ${{ steps.meta.outputs.tags }}
52+
labels: ${{ steps.meta.outputs.labels }}
53+
54+
# This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see [Using artifact attestations to establish provenance for builds](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
55+
- name: Generate artifact attestation
56+
uses: actions/attest-build-provenance@v2
57+
with:
58+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
59+
subject-digest: ${{ steps.push.outputs.digest }}
60+
push-to-registry: true

.github/workflows/test.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ "main" ]
7+
8+
jobs:
9+
test:
10+
strategy:
11+
matrix:
12+
node-version: ["18", "20", "22", "24"]
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
lfs: true
18+
19+
- name: Use Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: "${{ matrix.node-version }}"
23+
cache: 'yarn'
24+
25+
- name: Start wasmd
26+
run: RUNNER_TRACKING_ID="" && ./scripts/wasmd/start.sh &
27+
- name: Start simapp
28+
run: RUNNER_TRACKING_ID="" && ./scripts/simapp50/start.sh &
29+
- name: Start slow simapp
30+
run: RUNNER_TRACKING_ID="" && ./scripts/simapp50/slow_start.sh &
31+
- name: Start Tendermint blockchains
32+
run: RUNNER_TRACKING_ID="" && ./scripts/tendermint/all_start.sh &
33+
- name: Start socket server
34+
run: RUNNER_TRACKING_ID="" && ./scripts/socketserver/start.sh &
35+
- name: Start http server
36+
run: RUNNER_TRACKING_ID="" && ./scripts/httpserver/start.sh &
37+
38+
- name: Install dependencies
39+
run: yarn install --immutable --immutable-cache --check-cache
40+
41+
- name: Build
42+
run: yarn build
43+
44+
- name: Initialize wasmd (deploy contracts and friends)
45+
run: ./scripts/wasmd/init.sh
46+
47+
- name: Test
48+
env:
49+
HTTPSERVER_ENABLED: 1
50+
SIMAPP50_ENABLED: 1
51+
SLOW_SIMAPP50_ENABLED: 1
52+
TENDERMINT_ENABLED: 1
53+
SOCKETSERVER_ENABLED: 1
54+
SKIP_BUILD: 1
55+
WASMD_ENABLED: 1
56+
run: yarn test --stream
57+
- name: Run CLI selftest
58+
working-directory: packages/cli
59+
env:
60+
SKIP_BUILD: 1
61+
run: yarn selftest
62+
- name: Run CLI examples
63+
working-directory: packages/cli
64+
env:
65+
HTTPSERVER_ENABLED: 1
66+
SIMAPP50_ENABLED: 1
67+
SLOW_SIMAPP50_ENABLED: 1
68+
TENDERMINT_ENABLED: 1
69+
SOCKETSERVER_ENABLED: 1
70+
SKIP_BUILD: 1
71+
WASMD_ENABLED: 1
72+
run: ./run_examples.sh

0 commit comments

Comments
 (0)