Skip to content

Commit

Permalink
Instead of docker container use caching
Browse files Browse the repository at this point in the history
  • Loading branch information
noisekit committed Aug 15, 2023
1 parent 57a583c commit ecc48b2
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 43 deletions.
9 changes: 0 additions & 9 deletions .circleci/Dockerfile

This file was deleted.

5 changes: 0 additions & 5 deletions .circleci/README.md

This file was deleted.

67 changes: 65 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,71 @@
version: 2.1

parameters:
node-version:
type: string
default: "16.20.1"

commands:
yarn-install:
steps:
- run: yarn install --immutable --immutable-cache

install-foundry:
steps:
- restore_cache:
keys:
- foundry-{{ .Environment.FOUNDRY_CACHE_VERSION }}

- run:
name: "Install Foundry"
environment:
SHELL: /bin/bash
command: |-
if [ command -v anvil ]; then
echo "Anvil already installed"
anvil --version
else
curl -L https://foundry.paradigm.xyz | bash
export PATH="$PATH:$HOME/.foundry/bin"
echo export PATH="$PATH:$HOME/.foundry/bin" > $BASH_ENV
foundryup
fi
- save_cache:
key: foundry-{{ .Environment.CACHE_VERSION }}
paths:
- "~/.foundry"

install-ipfs:
steps:
- restore_cache:
keys:
- ipfs-{{ .Environment.IPFS_CACHE_VERSION }}

- run:
name: "Install IPFS"
command: |
if [ command -v ipfs ]; then
echo "IPFS already installed"
ipfs version
ipfs id
else
LATEST_VERSION=$(curl -sSL https://dist.ipfs.tech/go-ipfs/versions | tail -n 1)
LATEST_VERSION_NUMBER=${LATEST_VERSION#*v}
DOWNLOAD_URL="https://dist.ipfs.tech/go-ipfs/${LATEST_VERSION}/go-ipfs_${LATEST_VERSION}_linux-amd64.tar.gz"
echo "DOWNLOAD_URL=$DOWNLOAD_URL"
curl -sSL -o ipfs.tar.gz $DOWNLOAD_URL
tar -xzf ipfs.tar.gz
sudo cp -f ./go-ipfs/ipfs /usr/local/bin/
ipfs init
fi
- save_cache:
key: ipfs-{{ .Environment.CACHE_VERSION }}
paths:
- "~/go-ipfs"
- "~/.ipfs"

run-ipfs-daemon:
steps:
- run:
Expand All @@ -22,8 +83,9 @@ jobs:
docker:
- image: noisekit/synthetix-cci:node-16.20.1
steps:
- run: echo export PATH="$PATH:$HOME/.foundry/bin:$HOME/go-ipfs" > $BASH_ENV
- checkout
- install-foundry
- install-ipfs
- run-ipfs-daemon
- yarn-install
- run: yarn workspaces foreach --topological-dev --verbose run build:ts
Expand All @@ -47,8 +109,9 @@ jobs:
- image: noisekit/synthetix-cci:node-16.20.1
parallelism: 2
steps:
- run: echo export PATH="$PATH:$HOME/.foundry/bin:$HOME/go-ipfs" > $BASH_ENV
- checkout
- install-foundry
- install-ipfs
- run-ipfs-daemon
- yarn-install

Expand Down
11 changes: 0 additions & 11 deletions .circleci/install-foundry.sh

This file was deleted.

16 changes: 0 additions & 16 deletions .circleci/install-ipfs.sh

This file was deleted.

0 comments on commit ecc48b2

Please sign in to comment.