Skip to content

Commit

Permalink
Merge pull request #472 from coasys/dev
Browse files Browse the repository at this point in the history
Release v0.9.0
  • Loading branch information
lucksus authored Mar 23, 2024
2 parents 837575c + 80261a3 commit a10eb27
Show file tree
Hide file tree
Showing 246 changed files with 23,063 additions and 10,931 deletions.
62 changes: 62 additions & 0 deletions .circleci/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Use the CircleCI base image
FROM cimg/base:edge-22.04

USER root

# Install system dependencies or any other tools you need
RUN apt-get update && sudo apt-get install -y \
libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf protobuf-compiler cmake

# Install Go
ENV GO_VERSION 1.22.0
RUN wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz -O go.tar.gz \
&& tar -C /usr/local -xzf go.tar.gz \
&& rm go.tar.gz

# Set Go environment variables
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH

# Install Node
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && apt-get install -y nodejs


USER circleci

# Add /usr/local/bin to the PATH for the circleci user
RUN echo 'export PATH="/usr/local/bin:$PATH"' >> $HOME/.bashrc

# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> /home/circleci/.bashrc
RUN ~/.cargo/bin/rustup target add wasm32-unknown-unknown

# Install Deno
RUN curl -fsSL https://deno.land/install.sh | sh
RUN echo 'export DENO_INSTALL="/home/circleci/.deno"' >> /home/circleci/.bashrc
RUN echo 'export PATH="/home/circleci/.deno/bin:$PATH"' >> /home/circleci/.bashrc

# Configure npm to use a directory in the circleci user's home for global packages
RUN mkdir ~/.npm-global \
&& npm config set prefix '~/.npm-global' \
&& echo 'export PATH="~/.npm-global/bin:$PATH"' >> /home/circleci/.bashrc

# Install pnpm
RUN npm install -g pnpm

# Add other setup commands you require

USER root
# Clean up to reduce image size
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# Switch back to the circleci user for any non-root actions
USER circleci

# Set the PATH environment variable
ENV PATH="/home/circleci/.cargo/bin:/home/circleci/.deno/bin:/home/circleci/.npm-global/bin:$PATH"

# We need killall for the CLI tests
USER root
RUN apt-get update && apt-get install psmisc
USER circleci
178 changes: 178 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
version: 2.1

orbs:
node: circleci/[email protected]
go: circleci/[email protected]
rust: circleci/[email protected]

jobs:
build-and-test:
docker:
- image: coasys/ad4m-ci-linux:latest@sha256:7008f587d355d1adeb58553f52f99e1812822b4d21dc78d69bc96040d5e57e82
resource_class: xlarge
steps:
- checkout
- restore_cache:
keys:
- hc-0.3.0-beta-dev-27-v7
- hc-
- rust-cache-{{ checksum "Cargo.lock" }}
- rust-cache-
- run:
name: Install HC
command: |
ls -la $HOME/.cargo/bin
if [ ! -f "$HOME/.cargo/bin/hc" ]; then
git clone https://github.com/holochain/holochain.git
cd holochain
git checkout holochain-0.3.0-beta-dev.27
cd crates/hc
cargo build --release
pwd
ls -la
mkdir -p $HOME/.cargo/bin
cd ../../target/release
pwd
ls -lah
cp hc $HOME/.cargo/bin/hc
cd $HOME/.cargo/bin
pwd
ls -lah
./hc --version
fi
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> $BASH_ENV
- save_cache:
key: hc-0.3.0-beta-dev-27-v7
paths:
- /home/circleci/.cargo/bin
- restore_cache:
keys:
- rust-cache-{{ checksum "Cargo.lock" }}-v2
- rust-cache-
- run:
name: Install dependencies
command: pnpm install --no-frozen-lockfile
- run:
name: Build dapp
command: pnpm build-dapp
- run:
name: Install core dependencies
command: cd ./core && pnpm install --no-frozen-lockfile
- run:
name: Build ADAM (without bootstrap languages)
command: pnpm run build-libs
- save_cache:
key: rust-cache-{{ checksum "Cargo.lock" }}-v2
paths:
- ./target
- ~/.cargo/registry
- ~/.cargo/git
- persist_to_workspace:
no-output-timeout: 30m
root: .
paths:
- ./target/release/ad4m
- ./target/release/ad4m-executor
- run:
name: Remove pnpm patches
command: node removePnpm.js
- run:
name: Install dependencies
command: pnpm install --no-frozen-lockfile
- run:
name: Install core dependencies
command: cd ./core && pnpm install --no-frozen-lockfile
- run:
name: Root tests
command: pnpm test

integration-tests-js:
docker:
- image: coasys/ad4m-ci-linux:latest@sha256:7008f587d355d1adeb58553f52f99e1812822b4d21dc78d69bc96040d5e57e82
resource_class: xlarge
steps:
- checkout
- attach_workspace:
at: .
- restore_cache:
keys:
- hc-0.3.0-beta-dev-27-v7
- hc-
- restore_cache:
keys:
- agent-language-rust-cache-{{ checksum "bootstrap-languages/agent-language/hc-dna/Cargo.lock" }}
- agent-language-rust-cache-
- restore_cache:
keys:
- direct-message-language-rust-cache-{{ checksum "bootstrap-languages/direct-message-language/hc-dna/Cargo.lock" }}
- direct-message-language-rust-cache-
- restore_cache:
keys:
- file-storage-rust-cache-{{ checksum "bootstrap-languages/file-storage/hc-dna/Cargo.lock" }}
- file-storage-rust-cache-
- restore_cache:
keys:
- p-diff-sync-rust-cache-{{ checksum "bootstrap-languages/p-diff-sync/hc-dna/Cargo.lock" }}
- p-diff-sync-rust-cache-
- restore_cache:
keys:
- p-diff-sync-socket-signaling-rust-cache-{{ checksum "bootstrap-languages/p-diff-sync-socket-signaling/hc-dna/Cargo.lock" }}
- p-diff-sync-socket-signaling-rust-cache-
- run:
name: Install dependencies
command: pnpm install --no-frozen-lockfile
- run:
name: Install core dependencies
command: cd ./core && pnpm install --no-frozen-lockfile
- run:
name: Build bootstrap languages
command: pnpm run build-languages
- save_cache:
key: agent-language-rust-cache-{{ checksum "bootstrap-languages/agent-language/hc-dna/Cargo.lock" }}
paths:
- ./bootstrap-languages/agent-language/hc-dna/target
- save_cache:
key: direct-message-language-rust-cache-{{ checksum "bootstrap-languages/direct-message-language/hc-dna/Cargo.lock" }}
paths:
- ./bootstrap-languages/direct-message-language/hc-dna/target
- save_cache:
key: file-storage-rust-cache-{{ checksum "bootstrap-languages/file-storage/hc-dna/Cargo.lock" }}
paths:
- ./bootstrap-languages/file-storage-language/hc-dna/target
- save_cache:
key: p-diff-sync-rust-cache-{{ checksum "bootstrap-languages/p-diff-sync/hc-dna/Cargo.lock" }}
paths:
- ./bootstrap-languages/p-diff-sync/hc-dna/target
- save_cache:
key: p-diff-sync-socket-signaling-rust-cache-{{ checksum "bootstrap-languages/p-diff-sync-socket-signaling/hc-dna/Cargo.lock" }}
paths:
- ./bootstrap-languages/p-diff-sync-socket-signaling/hc-dna/target
- run:
name: Run integration tests
command: cd ./tests/js && pnpm run test-main

integration-tests-cli:
docker:
- image: coasys/ad4m-ci-linux:latest@sha256:7008f587d355d1adeb58553f52f99e1812822b4d21dc78d69bc96040d5e57e82
steps:
- checkout
- attach_workspace:
at: .
- run:
name: git submodule
command: git submodule update --init --recursive
- run:
name: Run binaries test script
command: ./tests/bats/bin/bats tests/binaries.bats
- run:
name: Run integration test script
command: ./tests/bats/bin/bats tests/integration.bats

workflows:
version: 2
build-and-test:
jobs:
- build-and-test
- integration-tests-js:
requires:
- build-and-test
2 changes: 1 addition & 1 deletion .github/workflows/agent-language-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.73.0
toolchain: 1.76.0

- name: Cache cargo
id: cache-cargo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/direct-message-language-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.73.0
toolchain: 1.76.0

- name: Cache cargo
id: cache-cargo
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/file-storage-language-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.73.0
toolchain: 1.76.0

- name: Cache cargo
id: cache-cargo
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.73.0
toolchain: 1.76.0

- name: Cache cargo
id: cache-cargo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: Integration

on:
push:
branches:
- main
- dev
pull_request:
# on:
# push:
# branches:
# - main
# pull_request:

jobs:
test:
Expand All @@ -26,7 +25,12 @@ jobs:
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: 1.73.0
toolchain: 1.76.0

- name: Use Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install protobuf & cmake
run: brew install protobuf cmake
Expand Down Expand Up @@ -77,4 +81,3 @@ jobs:

- name: Run integration test script
run: ./tests/bats/bin/bats tests/integration.bats || cat ~/Library/Logs/DiagnosticReports/*

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.73.0
toolchain: 1.76.0

- name: Install GO
uses: actions/setup-go@v4
Expand Down Expand Up @@ -71,6 +71,9 @@ jobs:
- name: Install dependencies
run: pnpm install --no-frozen-lockfile

- name: Install core dependencies
run: cd ./core && pnpm install --no-frozen-lockfile

- name: Build the workspace
run: pnpm run build

Expand All @@ -89,7 +92,7 @@ jobs:
run: pnpm test

- name: Run integration tests
run: cd ./tests/js && pnpm run test-main
run: cd ./tests/js && yarn run test-main

# test-windows:
# name: JS Ad4mClient <> AD4M Executor - Windows
Expand Down
Loading

0 comments on commit a10eb27

Please sign in to comment.