-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
version: 2.1 | ||
|
||
parameters: | ||
node-version: | ||
type: string | ||
default: "18.17.1" | ||
|
||
commands: | ||
yarn-install: | ||
steps: | ||
- run: yarn install --immutable --immutable-cache | ||
|
||
install-foundry: | ||
steps: | ||
- run: | ||
name: "Install foundry used for cannon and e2e tests" | ||
environment: | ||
SHELL: /bin/bash | ||
command: |- | ||
apt update && apt install --yes curl | ||
curl -L https://foundry.paradigm.xyz | bash | ||
export PATH="$PATH:$HOME/.foundry/bin" | ||
echo export PATH="$PATH:$HOME/.foundry/bin" > $BASH_ENV | ||
foundryup | ||
install-ipfs: | ||
steps: | ||
- run: | ||
name: "Install IPFS" | ||
command: | | ||
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 | ||
run-ipfs-daemon: | ||
steps: | ||
- run: | ||
command: ipfs daemon | ||
background: true | ||
|
||
wait-for-ipfs: | ||
steps: | ||
- run: | ||
name: "Wait for IPFS daemon to start" | ||
command: wget --retry-connrefused --waitretry=20 --read-timeout=20 --timeout=15 -t 10 --post-data '' "http://localhost:5001/api/v0/version" | ||
|
||
jobs: | ||
test: | ||
parameters: | ||
workspace: | ||
type: string | ||
docker: | ||
- image: cimg/node:<< pipeline.parameters.node-version >> | ||
# resource_class: large | ||
environment: | ||
NODE_ENV: test | ||
steps: | ||
- checkout | ||
- install-foundry | ||
- install-ipfs | ||
- run-ipfs-daemon | ||
- yarn-install | ||
|
||
- run: yarn workspaces foreach --topological-dev --recursive --verbose --from "<< parameters.workspace >>" run build:ts | ||
|
||
- run: yarn workspaces foreach --topological-dev --recursive --verbose --from "<< parameters.workspace >>" run build-testable | ||
|
||
workflows: | ||
version: 2.1 | ||
|
||
ui: | ||
jobs: | ||
- test: | ||
name: "test-main" | ||
workspace: "@synthetixio/main" |