Skip to content

Commit

Permalink
fix: format workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
tgunnoe committed Jul 31, 2024
1 parent 57f04a2 commit 708f50e
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 52 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/binary-zip.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build zip with all artifacts

on:

workflow_dispatch:
inputs:
partner_chains_smart_contracts_sha:
Expand Down Expand Up @@ -163,21 +164,21 @@ jobs:
token: ${{ secrets.ACTIONS_PAT }}
ref: ${{ github.event.inputs.partner_chains_smart_contracts_sha }}
path: partner-chains-smart-contracts

- name: Build
run: nix build ./partner-chains-smart-contracts#sidechain-release-bundle

- name: Prepare Artifact
run: |
mkdir -p partner-chains-smart-contracts-artifact
cp result/* partner-chains-smart-contracts-artifact
- name: Upload Directory as Artifact
uses: actions/upload-artifact@v4
with:
name: partner-chains-smart-contracts-artifact
path: partner-chains-smart-contracts-artifact/

- name: Post-build Cleanup
run: rm -rf partner-chains-smart-contracts-artifact

Expand All @@ -189,31 +190,31 @@ jobs:
curl -LO https://nodejs.org/dist/v20.12.2/node-v20.12.2-linux-x64.tar.xz
tar -xf node-v20.12.2-linux-x64.tar.xz
mv node-v20.12.2-linux-x64 nodejs-linux
- name: Download Node.js binary for x86_64 macOS
run: |
curl -LO https://nodejs.org/dist/v20.12.2/node-v20.12.2-darwin-x64.tar.gz
tar -xf node-v20.12.2-darwin-x64.tar.gz
mv node-v20.12.2-darwin-x64 nodejs-macos-x86_64
- name: Download Node.js binary for ARM macOS
run: |
curl -LO https://nodejs.org/dist/v20.12.2/node-v20.12.2-darwin-arm64.tar.gz
tar -xf node-v20.12.2-darwin-arm64.tar.gz
mv node-v20.12.2-darwin-arm64 nodejs-macos-arm64
- name: Upload Node.js binary for Linux
uses: actions/upload-artifact@v4
with:
name: nodejs-linux
path: nodejs-linux/

- name: Upload Node.js binary for x86_64 macOS
uses: actions/upload-artifact@v4
with:
name: nodejs-macos-x86_64
path: nodejs-macos-x86_64/

- name: Upload Node.js binary for ARM macOS
uses: actions/upload-artifact@v4
with:
Expand All @@ -228,7 +229,7 @@ jobs:
uses: actions/download-artifact@v4
with:
path: combined-artifacts/

- name: Unzip and Prepare Trustless Artifact
run: |
mkdir -p combined-artifacts/partner-chains-smart-contracts-artifact-dir
Expand All @@ -238,7 +239,7 @@ jobs:
mv combined-artifacts/partner-chains-smart-contracts-artifact-dir/node_modules combined-artifacts/
rm -rf combined-artifacts/partner-chains-smart-contracts-artifact-dir/release.zip
rm -rf combined-artifacts/partner-chains-smart-contracts-artifact-dir
- name: Create Linux ZIP
run: |
mkdir -p combined-artifacts/linux_x86_64-dir
Expand All @@ -250,13 +251,13 @@ jobs:
ls -la combined-artifacts/linux_x86_64-dir
cd combined-artifacts/linux_x86_64-dir
zip -r ../../linux_x86_64.zip .
- name: Upload Linux ZIP
uses: actions/upload-artifact@v4
with:
name: linux_x86_64
path: linux_x86_64.zip

- name: Create macOS x86_64 ZIP
run: |
mkdir -p combined-artifacts/macos_x86_64-dir
Expand All @@ -268,13 +269,13 @@ jobs:
ls -la combined-artifacts/macos_x86_64-dir
cd combined-artifacts/macos_x86_64-dir
zip -r ../../macos_x86_64.zip .
- name: Upload macOS x86_64 ZIP
uses: actions/upload-artifact@v4
with:
name: macos_x86_64
path: macos_x86_64.zip

- name: Create macOS ARM64 ZIP
run: |
mkdir -p combined-artifacts/macos_arm64-dir
Expand All @@ -286,7 +287,7 @@ jobs:
ls -la combined-artifacts/macos_arm64-dir
cd combined-artifacts/macos_arm64-dir
zip -r ../../macos_arm64.zip .
- name: Upload macOS ARM64 ZIP
uses: actions/upload-artifact@v4
with:
Expand Down
43 changes: 22 additions & 21 deletions .github/workflows/devnet-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Deploy Devnet

on:

workflow_dispatch:
inputs:
terms1:
Expand Down Expand Up @@ -45,7 +46,7 @@ jobs:
exit 1
fi
echo "All terms and conditions accepted."
- name: Confirm Inputs and Evaluate Conditions
id: evaluate-conditions
run: |
Expand All @@ -56,19 +57,19 @@ jobs:
echo "wipe: ${{ github.event.inputs.wipe }}"
echo "rolling: ${{ github.event.inputs.rolling }}"
echo "Evaluating Deployment Type..."
if [[ "${{ github.event.inputs.wipe }}" == 'true' ]]; then
echo "wipe=true" >> $GITHUB_ENV
else
echo "wipe=false" >> $GITHUB_ENV
fi
if [[ "${{ github.event.inputs.rolling }}" == 'true' ]]; then
echo "rolling=true" >> $GITHUB_ENV
else
echo "rolling=false" >> $GITHUB_ENV
fi
if [[ "${{ github.event.inputs.wipe }}" == 'true' && "${{ github.event.inputs.chain-spec-secret-name }}" != '' && "${{ github.event.inputs.substrate-node-image }}" != '' ]]; then
echo "deployment_type=1" >> $GITHUB_ENV
echo "Step: Deploy with chain-spec and image override will be run"
Expand Down Expand Up @@ -138,7 +139,7 @@ jobs:
kubectl delete pvc henry-claim-substrate-node-data -n sc
echo "Waiting for all PVCs to delete..."
kubectl wait --for=delete pvc/alice-claim-substrate-node-data pvc/bob-claim-substrate-node-data pvc/charlie-claim-substrate-node-data pvc/dave-claim-substrate-node-data pvc/eve-claim-substrate-node-data pvc/ferdie-claim-substrate-node-data pvc/greg-claim-substrate-node-data pvc/henry-claim-substrate-node-data -n sc --timeout=120s
- name: Deploy with chain-spec and image override
if: env.deployment_type == 1
run: |
Expand All @@ -151,7 +152,7 @@ jobs:
helm upgrade --install ferdie . -f values/chains/devnet.yaml -f values/nodes/devnet/ferdie.yaml --set images.substrateNode="${{ github.event.inputs.substrate-node-image }}" --set chain.chainspec_secretName="${{ github.event.inputs.chain-spec-secret-name }}"
helm upgrade --install greg . -f values/chains/devnet.yaml -f values/nodes/devnet/greg.yaml --set images.substrateNode="${{ github.event.inputs.substrate-node-image }}" --set chain.chainspec_secretName="${{ github.event.inputs.chain-spec-secret-name }}"
helm upgrade --install henry . -f values/chains/devnet.yaml -f values/nodes/devnet/henry.yaml --set images.substrateNode="${{ github.event.inputs.substrate-node-image }}" --set chain.chainspec_secretName="${{ github.event.inputs.chain-spec-secret-name }}"
- name: Deploy with image override
if: env.deployment_type == 2
run: |
Expand All @@ -164,7 +165,7 @@ jobs:
helm upgrade --install ferdie . -f values/chains/devnet.yaml -f values/nodes/devnet/ferdie.yaml --set images.substrateNode="${{ github.event.inputs.substrate-node-image }}"
helm upgrade --install greg . -f values/chains/devnet.yaml -f values/nodes/devnet/greg.yaml --set images.substrateNode="${{ github.event.inputs.substrate-node-image }}"
helm upgrade --install henry . -f values/chains/devnet.yaml -f values/nodes/devnet/henry.yaml --set images.substrateNode="${{ github.event.inputs.substrate-node-image }}"
- name: Deploy from master with no value overrides
if: env.deployment_type == 3
run: |
Expand All @@ -182,51 +183,51 @@ jobs:
run: |
echo "Waiting for Alice..."
kubectl wait --for=condition=ready pod alice -n sc --timeout=300s
echo "Waiting for Bob..."
kubectl wait --for=condition=ready pod bob -n sc --timeout=300s
echo "Waiting for Charlie..."
kubectl wait --for=condition=ready pod charlie -n sc --timeout=300s
echo "Waiting for Dave..."
kubectl wait --for=condition=ready pod dave -n sc --timeout=300s
echo "Waiting for Eve..."
kubectl wait --for=condition=ready pod eve -n sc --timeout=300s
echo "Waiting for Ferdie..."
kubectl wait --for=condition=ready pod ferdie -n sc --timeout=300s
echo "Waiting for Greg..."
kubectl wait --for=condition=ready pod greg -n sc --timeout=300s
echo "Waiting for Henry..."
kubectl wait --for=condition=ready pod henry -n sc --timeout=300s
- name: Validate
run: |
echo "Checking Alice..."
kubectl get pod alice -n sc -o jsonpath="{.status.containerStatuses[*].ready}"
echo "Checking Bob..."
kubectl get pod bob -n sc -o jsonpath="{.status.containerStatuses[*].ready}"
echo "Checking Charlie..."
kubectl get pod charlie -n sc -o jsonpath="{.status.containerStatuses[*].ready}"
echo "Checking Dave..."
kubectl get pod dave -n sc -o jsonpath="{.status.containerStatuses[*].ready}"
echo "Checking Eve..."
kubectl get pod eve -n sc -o jsonpath="{.status.containerStatuses[*].ready}"
echo "Checking Ferdie..."
kubectl get pod ferdie -n sc -o jsonpath="{.status.containerStatuses[*].ready}"
echo "Checking Greg..."
kubectl get pod greg -n sc -o jsonpath="{.status.containerStatuses[*].ready}"
echo "Checking Henry..."
kubectl get pod henry -n sc -o jsonpath="{.status.containerStatuses[*].ready}"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: e2e tests

on:

workflow_call:
inputs:
node-host:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/earthly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
ssh_key: ${{ secrets.SUBSTRATE_REPO_SSH_KEY }}
config_tar: ${{ secrets.EARTHLY_TAR }}

- name: Build With Benchmarking Features Enabled
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci-off') && (github.ref_name == 'master' || inputs.upload == 'true') }}
env:
Expand Down Expand Up @@ -88,15 +88,15 @@ jobs:
done
docker stop weight_generation
docker rm weight_generation
- name: Upload Weights
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci-off') && (github.ref_name == 'master' || inputs.upload == 'true') }}
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: weights
path: weights/

- name: Overwrite Weights in Runtime Directory
continue-on-error: true
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci-off') && (github.ref_name == 'master' || inputs.upload == 'true') }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ghcr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build and Publish to GHCR Public Repository

on:

workflow_dispatch:
inputs:
commit_sha:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/partner-chains-node-binary-host.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build partner-chains-node and partner-chains-cli and push to binary-host

on:

workflow_dispatch:
inputs:
push_to_binary_host:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-doc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Publish Documentation

on:

push:
branches:
- master
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/sidechain-main-cli-binary-host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:

- name: Build
run: nix build ./partner-chains-smart-contracts#sidechain-release-bundle

- name: Prepare Artifact
run: |
mkdir -p partner-chains-smart-contracts-artifact
cp result/* partner-chains-smart-contracts-artifact
- name: Upload Directory as Artifact
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
sudo apt update && sudo apt install -y awscli
- name: Configure kubectl
run: |
echo "${{ secrets.kubeconfig_base64 }}" | base64 --decode > ${{ runner.temp }}/kubeconfig.yaml
Expand All @@ -93,8 +93,8 @@ jobs:
uses: actions/download-artifact@v4
with:
name: unzipped
path: artifact/unzipped
path: artifact/unzipped

- name: Create SHA directory on binary-host
run: |
kubectl exec binary-host -c binary-host -n sc -- mkdir -p /tools/sidechain-main-cli/${{ github.event.inputs.commit_sha }}
Expand Down
Loading

0 comments on commit 708f50e

Please sign in to comment.