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 81c47a2
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 45 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.

74 changes: 70 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,74 @@
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"
working_directory: ~/
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"
working_directory: ~/
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
export PATH="$PATH:$HOME/go-ipfs"
echo 'export PATH=$PATH:$HOME/go-ipfs' >> $BASH_ENV
ipfs init
fi
- save_cache:
key: ipfs-{{ .Environment.CACHE_VERSION }}
paths:
- "~/go-ipfs"
- "~/.ipfs"

run-ipfs-daemon:
steps:
- run:
Expand All @@ -20,10 +84,11 @@ commands:
jobs:
build-testable:
docker:
- image: noisekit/synthetix-cci:node-16.20.1
- image: cimg/node:<< pipeline.parameters.node-version >>
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 @@ -44,11 +109,12 @@ jobs:
workspace:
type: string
docker:
- image: noisekit/synthetix-cci:node-16.20.1
- image: cimg/node:<< pipeline.parameters.node-version >>
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 81c47a2

Please sign in to comment.