-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: move cicd.yml feat: modular ghcr feat: more modules feat: more modules feat: local-environment module feat: no sha fix: pcsc fix: path fix: needs fix: --node-image fix: description feat: more modules feat: inputs feat: inputs feat: parse flake.nix Run e2e tests on local env (#85) added: - run e2e tests workflow changed: - use 0.8 slot coeff in MC feat: move composites feat: staging-preprod feat: dir tree feat: tests feat: ci + cd fix: checkouts feat: more modules feat: earthly fix: devshell tests fix: releases feat: validator names feat: chain-specs feat: keep live workflows feat: workflow_call > composite fix: earthly.yml feat: remove concurency feat: permissions fix: permissions fix: indentation fix: chain-specs fix: permissions fix: earthly-setup fix: ref fix: earthly.yml fix: region fix: earthly-setup fix: earthly feat: remove earthly fix: main build fix: if conditions fix: envs paths fix: chain-specs fix: devshell tests fix: typo fix: only ci and cd! fix: always upload chain-specs feat: simulate merge feat: checkout for every job feat: secrets > envs feat: wait-for-epoch feat: simplify tests feat: remove argocd from CI and move to CD feat: local-environment in CI fix: don't checkout master fix: build linux fix: pcsc fix: concurrency fix: remove pcsc fix: remove concurrency fix: rename checked out repo in local tests action add: fallback checkout of pc-tests in local-env-tests workflow feat: build with earthly fix: setup fix: env fix: earthly artifacts fix: earthly setup fix: local-environment tests fix: ECR REGISTRY fix: artifact name fix: artifact names fix: single earthly fix: needs fix: debug feat: debugging fix: artifact name feat: single job feat: debug fix: partner-chains-cli feat: debug feat: artifact fix: checkout sha fix: debug fix: more debugging feat: mv feat: debug feat: debug feat: debug fix: checkout fix: path fix: placeholder fix: path fix: postgres fix: node image feat: debug fix: overrides fix: fi fix: env vars feat: workflows fix: run-e2e-tests fix: run-e2e-tests feat: argocd too? fix: path fix: smoke fix: PAT fix: uses fix: ECR fix: cd back fix: always teardown fix: remove allure feat: e2e-tests fix: e2e-tests feat: rebase fix: local-env files Delete dev/local-environment/docker-compose.yml.bak fix: always tear down fix: .github feat: TEST_ENVIRONMENT: CI feat: pre-merge success marker fix: pc-demo TEST_ENVIRONMENT fix: local secrets not encrypted fix: don't run argo on earthly satellite fix: wait for epoch action path fix: ssh auth sock fix: teardown action fix: docker compose down feat: cosmetic post-merge-complete fix: if feat: argocd interval feat: sleep 90 fix: run e2e tests in 4 epochs instead of 7 add: argocd checkout ref_name and fallback feat: ghcr fix: checkout e2e tests via ref_name
- Loading branch information
1 parent
3e0963e
commit f3ae979
Showing
49 changed files
with
2,171 additions
and
1,148 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
106 changes: 106 additions & 0 deletions
106
.github/actions/artifacts/build-pc-artifacts/action.yml
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,106 @@ | ||
name: "Build and Upload PC Artifacts" | ||
description: "Build and upload partner-chains artifacts for Linux, macOS x86_64, and macOS arm64" | ||
inputs: | ||
sha: | ||
description: "partner-chains commit SHA or branch to build from" | ||
required: true | ||
tag: | ||
description: "partner-chains release tag to append to artifact name" | ||
required: true | ||
os: | ||
description: "Operating system for the build (linux, macos-x86_64, macos-arm64)" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set filename variables | ||
shell: bash | ||
run: | | ||
if [[ "${{ inputs.os }}" == "linux" ]]; then | ||
echo "PARTNER_CHAINS_CLI=partner-chains-cli-${{ inputs.tag }}-x86_64-linux" >> $GITHUB_ENV | ||
echo "PARTNER_CHAINS_NODE=partner-chains-node-${{ inputs.tag }}-x86_64-linux" >> $GITHUB_ENV | ||
elif [[ "${{ inputs.os }}" == "macos-x86_64" ]]; then | ||
echo "PARTNER_CHAINS_CLI=partner-chains-cli-${{ inputs.tag }}-x86_64-apple-darwin" >> $GITHUB_ENV | ||
echo "PARTNER_CHAINS_NODE=partner-chains-node-${{ inputs.tag }}-x86_64-apple-darwin" >> $GITHUB_ENV | ||
elif [[ "${{ inputs.os }}" == "macos-arm64" ]]; then | ||
echo "PARTNER_CHAINS_CLI=partner-chains-cli-${{ inputs.tag }}-aarch64-apple-darwin" >> $GITHUB_ENV | ||
echo "PARTNER_CHAINS_NODE=partner-chains-node-${{ inputs.tag }}-aarch64-apple-darwin" >> $GITHUB_ENV | ||
fi | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.sha }} | ||
|
||
- name: Install protoc | ||
shell: bash | ||
run: | | ||
if [[ "${{ inputs.os }}" == "linux" ]]; then | ||
sudo apt-get install -y protobuf-compiler | ||
elif [[ "${{ inputs.os }}" == "macos-x86_64" ]]; then | ||
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.3/protoc-21.3-osx-x86_64.zip | ||
unzip protoc-21.3-osx-x86_64.zip -d $HOME/protoc | ||
sudo mv $HOME/protoc/bin/protoc /usr/local/bin/protoc | ||
elif [[ "${{ inputs.os }}" == "macos-arm64" ]]; then | ||
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.3/protoc-21.3-osx-aarch_64.zip | ||
unzip protoc-21.3-osx-aarch_64.zip -d $HOME/protoc | ||
sudo mv $HOME/protoc/bin/protoc /usr/local/bin/protoc | ||
fi | ||
- name: Build partner-chains-node | ||
run: | | ||
if [[ "${{ inputs.os }}" == "linux" ]]; then | ||
rustup target add x86_64-unknown-linux-gnu | ||
cargo build -p partner-chains-node --locked --release --target x86_64-unknown-linux-gnu | ||
cp target/x86_64-unknown-linux-gnu/release/partner-chains-node $PARTNER_CHAINS_NODE | ||
elif [[ "${{ inputs.os }}" == "macos-x86_64" ]]; then | ||
rustup target add x86_64-apple-darwin | ||
cargo build -p partner-chains-node --locked --release --target x86_64-apple-darwin | ||
cp target/x86_64-apple-darwin/release/partner-chains-node $PARTNER_CHAINS_NODE | ||
elif [[ "${{ inputs.os }}" == "macos-arm64" ]]; then | ||
rustup target add aarch64-apple-darwin | ||
cargo build -p partner-chains-node --locked --release --target aarch64-apple-darwin | ||
cp target/aarch64-apple-darwin/release/partner-chains-node $PARTNER_CHAINS_NODE | ||
fi | ||
shell: bash | ||
|
||
- name: Test partner-chains-node | ||
shell: bash | ||
run: | | ||
if [[ "${{ inputs.os }}" == "linux" ]]; then | ||
cargo test --locked --release --target x86_64-unknown-linux-gnu | ||
elif [[ "${{ inputs.os }}" == "macos-x86_64" ]]; then | ||
cargo test --locked --release --target x86_64-apple-darwin | ||
elif [[ "${{ inputs.os }}" == "macos-arm64" ]]; then | ||
cargo test --locked --release --target aarch64-apple-darwin | ||
fi | ||
- name: Build partner-chains-cli | ||
shell: bash | ||
run: | | ||
if [[ "${{ inputs.os }}" == "linux" ]]; then | ||
rustup target add x86_64-unknown-linux-gnu | ||
cargo build -p partner-chains-cli --locked --release --target x86_64-unknown-linux-gnu | ||
cp target/x86_64-unknown-linux-gnu/release/partner-chains-cli $PARTNER_CHAINS_CLI | ||
elif [[ "${{ inputs.os }}" == "macos-x86_64" ]]; then | ||
rustup target add x86_64-apple-darwin | ||
cargo build -p partner-chains-cli --locked --release --target x86_64-apple-darwin | ||
cp target/x86_64-apple-darwin/release/partner-chains-cli $PARTNER_CHAINS_CLI | ||
elif [[ "${{ inputs.os }}" == "macos-arm64" ]]; then | ||
rustup target add aarch64-apple-darwin | ||
cargo build -p partner-chains-cli --locked --release --target aarch64-apple-darwin | ||
cp target/aarch64-apple-darwin/release/partner-chains-cli $PARTNER_CHAINS_CLI | ||
fi | ||
- name: Upload partner-chains-cli artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: partner-chains-cli-${{ inputs.os }}-artifact | ||
path: ${{ env.PARTNER_CHAINS_CLI }} | ||
|
||
- name: Upload partner-chains-node artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: partner-chains-node-${{ inputs.os }}-artifact | ||
path: ${{ env.PARTNER_CHAINS_NODE }} |
55 changes: 55 additions & 0 deletions
55
.github/actions/artifacts/download-pcsc-artifact/action.yml
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,55 @@ | ||
name: "Parse Flake and Download PCSC Release" | ||
description: "Extracts PCSC release info from flake.nix, constructs an artifact name, downloads, and uploads the artifact" | ||
inputs: | ||
sha: | ||
description: "SHA or branch to checkout" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.sha }} | ||
|
||
- name: Extract PCSC Release Info from flake.nix | ||
shell: bash | ||
id: extract-release | ||
run: | | ||
echo "Extracting PCSC release version from flake.nix..." | ||
release=$(grep -Po 'url = "github:input-output-hk/partner-chains-smart-contracts/v\K[0-9.]+(?=";)' flake.nix) | ||
echo "Release version: v$release" | ||
echo "::set-output name=release::v$release" | ||
- name: Construct Artifact Name | ||
shell: bash | ||
id: construct-artifact | ||
run: | | ||
version_without_v=${{ steps.extract-release.outputs.release#v }} | ||
artifact="trustless-sidechain-cli-${version_without_v}-x86_64-linux.zip" | ||
echo "Constructed artifact name: $artifact" | ||
echo "::set-output name=artifact::$artifact" | ||
- name: Download Artifact as zipped.zip | ||
shell: bash | ||
run: | | ||
wget -O zipped.zip "https://github.com/input-output-hk/partner-chains-smart-contracts/releases/download/${{ steps.extract-release.outputs.release }}/${{ steps.construct-artifact.outputs.artifact }}" | ||
- name: Extract zipped.zip to a temporary directory | ||
shell: bash | ||
run: | | ||
mkdir temp_dir | ||
unzip zipped.zip -d temp_dir | ||
- name: Rename extracted directory to partner-chains-smart-contracts | ||
shell: bash | ||
run: | | ||
original_dir=$(ls temp_dir) | ||
mv "temp_dir/$original_dir" partner-chains-smart-contracts | ||
- name: Upload Extracted Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: partner-chains-smart-contracts-artifact | ||
path: partner-chains-smart-contracts |
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,35 @@ | ||
name: "Generate Chain Specs from Node Binary" | ||
description: "Downloads the partner-chains node binary, generates chain specs for different environments, and uploads them." | ||
inputs: | ||
sha: | ||
description: "Commit SHA to append to chain spec secret name" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Download Linux partner-chains-node artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: partner-chains-node-x86_64-linux-artifact-artifact | ||
path: ./ | ||
|
||
- name: Generate Chain Specs | ||
shell: bash | ||
run: | | ||
chmod +x ./partner-chains-node | ||
source ./envs/devnet/.envrc | ||
./partner-chains-node build-spec --chain local --disable-default-bootnode --raw > devnet_chain_spec.json | ||
source ./envs/staging-preview/.envrc | ||
./partner-chains-node build-spec --chain staging --disable-default-bootnode --raw > staging_preview_chain_spec.json | ||
source ./envs/staging-preprod/.envrc | ||
./partner-chains-node build-spec --chain staging --disable-default-bootnode --raw > staging_preprod_chain_spec.json | ||
- name: Upload Chain Specs | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: chain-specs | ||
path: | | ||
devnet_chain_spec.json | ||
staging_preview_chain_spec.json | ||
staging_preprod_chain_spec.json |
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,26 @@ | ||
name: "Deploy ArgoCD Node" | ||
description: "Deploys an ArgoCD node using a specified commit SHA." | ||
inputs: | ||
sha: | ||
description: "Commit SHA" | ||
required: true | ||
|
||
outputs: {} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create and Push Manifest | ||
env: | ||
GH_TOKEN: ${{ env.ACTIONS_PAT }} | ||
run: | | ||
cd .github/actions/deploy/argocd/ | ||
bash generate-manifest.sh ${{ inputs.sha }} | ||
shell: bash | ||
|
||
- name: Wait for 8.5 minutes (ArgoCD refresh interval is 15s + 15s to build + 60s for node to start producing blocks) | ||
run: sleep 90 | ||
shell: bash |
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
File renamed without changes.
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,52 @@ | ||
name: "Teardown ArgoCD Environment" | ||
description: "Tears down an ArgoCD environment by removing an ephemeral environment file." | ||
inputs: | ||
sha: | ||
description: "SHA of the commit" | ||
required: true | ||
|
||
outputs: {} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout ArgoCD Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: input-output-hk/sidechains-argocd | ||
token: ${{ env.ACTIONS_PAT }} | ||
path: sidechains-argocd | ||
|
||
- name: Delete Ephemeral Environment File | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ env.ACTIONS_PAT }} | ||
script: | | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const directory = 'sidechains-argocd/integration-testing'; | ||
const targetFile = `manifest-sha-${{ inputs.sha }}.yaml`; | ||
const filePath = path.join(directory, targetFile); | ||
if (fs.existsSync(filePath)) { | ||
console.log(`Deleting file: ${targetFile}`); | ||
const shaResponse = await github.rest.repos.getContent({ | ||
owner: 'input-output-hk', | ||
repo: 'sidechains-argocd', | ||
path: `integration-testing/${targetFile}`, | ||
}); | ||
const fileSha = shaResponse.data.sha; | ||
await github.rest.repos.deleteFile({ | ||
owner: 'input-output-hk', | ||
repo: 'sidechains-argocd', | ||
path: `integration-testing/${targetFile}`, | ||
message: `ci: Tear down integration-testing environment for SHA ${{ inputs.sha }}`, | ||
sha: fileSha, | ||
branch: 'main' | ||
}); | ||
} else { | ||
console.log(`File not found: ${targetFile}`); | ||
} |
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,51 @@ | ||
name: "Deploy Rust Docs" | ||
description: "Installs necessary tooling, generates Rust documentation, and deploys it to GitHub Pages." | ||
inputs: | ||
ssh_key: | ||
description: "SSH key to read Substrate Repo" | ||
required: true | ||
|
||
outputs: {} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install tooling | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y protobuf-compiler | ||
protoc --version | ||
shell: bash | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Add SSH key to read Substrate Repo | ||
run: | | ||
mkdir -p ~/.ssh | ||
ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
ssh-agent -a /tmp/ssh_agent.sock > /dev/null | ||
ssh-add - <<< "${{ inputs.ssh_key }}" | ||
shell: bash | ||
|
||
- name: Rust versions | ||
run: rustup show | ||
shell: bash | ||
|
||
- name: Rust cache | ||
uses: Swatinem/rust-cache@v2.6.2 | ||
|
||
- name: Build rustdocs | ||
run: SKIP_WASM_BUILD=1 cargo doc --all --no-deps | ||
shell: bash | ||
|
||
- name: Make index.html | ||
run: echo "<meta http-equiv=refresh content=0;url=node_template/index.html>" > ./target/doc/index.html | ||
shell: bash | ||
|
||
- name: Deploy documentation | ||
if: ${{ github.ref_name == 'master' }} | ||
uses: peaceiris/actions-gh-pages@v3.9.3 | ||
with: | ||
publish_branch: gh-pages | ||
publish_dir: ./target/doc |
Oops, something went wrong.