Skip to content

Commit

Permalink
fix: ci (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
osipov-mit authored Dec 4, 2024
1 parent 42ef3ed commit 321dc5b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 23 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'CI'
name: "CI"

on:
pull_request:
Expand All @@ -15,33 +15,27 @@ jobs:
access_token: ${{ github.token }}
- uses: actions/checkout@v2

- name: Install NodeJS 18.x
- name: Install NodeJS 20.x
uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 20.x

- name: Download Gear node [release=build]
run: wget -O ./gear https://github.com/gear-tech/gear/releases/download/build/gear

- name: Build spec
run: |
wget -O ./gear https://github.com/gear-tech/gear/releases/download/build/gear
chmod +x ./gear
./gear build-spec --dev > dev.json
- name: Install rosetta-cli tool
run: curl -sSfL https://raw.githubusercontent.com/coinbase/rosetta-cli/master/scripts/install.sh | sh -s

- name: Install dependencies
run: yarn install

- name: Build
run: yarn build

- name: Update balances
run: node ./test/set-prefunded-acc.js ./dev.json ./test/development/config.json
run: yarn build

- name: Run Gear node
run: nohup ./gear --chain ./dev.json --validator --alice --tmp --pruning archive --unsafe-rpc-external --rpc-methods Unsafe --rpc-cors all &
run: nohup ./gear --dev --tmp --execution wasm --pruning=archive --unsafe-rpc-external --rpc-methods Unsafe --rpc-cors all &

- name: "Prepare: sleep"
run: sleep 180
Expand All @@ -62,10 +56,10 @@ jobs:

- name: Run check:data
run: ./bin/rosetta-cli --configuration-file ./test/development/config.json check:data

- name: Find out the balance of the prefunded account
run: |
curl -L 'http://127.0.0.1:8080/account/balance' -H 'Content-Type: application/json' -d '{"account_identifier": {"address": "kGkfymFqB4aBVunXCW69EzQRDtkZkUQB44GB4XJnwNwqmWyRN"},"network_identifier": {"blockchain": "gear","network": "development"}}'
curl -L 'http://127.0.0.1:8080/account/balance' -H 'Content-Type: application/json' -d '{"account_identifier": {"address": "kGkfymFqB4aBVunXCW69EzQRDtkZkUQB44GB4XJnwNwqmWyRN"},"network_identifier": {"blockchain": "vara","network": "development"}}'
- name: Run check:construction
run: ./bin/rosetta-cli --configuration-file ./test/development/config.json check:construction
14 changes: 7 additions & 7 deletions Dockerfile-testnet
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN apt update -y && apt install -y clang gcc git gzip make tar wget unzip curl

RUN git clone https://github.com/gear-tech/gear.git

WORKDIR gear
WORKDIR /gear

ARG PROTOC_ZIP=protoc-3.14.0-linux-x86_64.zip
RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/$PROTOC_ZIP
Expand Down Expand Up @@ -47,7 +47,7 @@ RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2023-04-25
# Build
RUN cargo build -p gear-cli --profile $PROFILE

### Final Image
### Final Image

FROM ubuntu:22.04
RUN apt update -y
Expand All @@ -65,15 +65,15 @@ COPY --from=builder-rosetta /usr/src /opt/rosetta-api
ARG PROFILE=production
COPY --from=builder-gear /gear/target/$PROFILE/gear /usr/local/bin
RUN useradd -m -u 1000 -U -s /bin/sh -d /gear gear && \
mkdir -p /gear/.local/share && \
mkdir /data && \
chown -R gear:gear /data && \
ln -s /data /gear/.local/share/gear
mkdir -p /gear/.local/share && \
mkdir /data && \
chown -R gear:gear /data && \
ln -s /data /gear/.local/share/gear

USER root

# Copy conf files
COPY config/rosetta/testnet.json /opt/testnet.json
COPY config/rosetta/vara-testnet.json /opt/vara-testnet.json
COPY supervisord-testnet.conf /etc/supervisor/conf.d/supervisord.conf

EXPOSE 8080
Expand Down

0 comments on commit 321dc5b

Please sign in to comment.