-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GA pipeline for E2E tests (without secrets)
- Loading branch information
Showing
4 changed files
with
141 additions
and
3 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,42 @@ | ||
name: E2E Setup | ||
description: Setup environment for E2E tests | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16" | ||
|
||
- name: Install Yarn | ||
run: sudo npm install -g yarn | ||
|
||
- name: Setup Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: 1.80.0 | ||
target: wasm32-unknown-unknown | ||
|
||
- name: Install NEAR CLI | ||
run: | | ||
cargo install --git https://github.com/Near-One/bridge-sdk-rs/ --rev 543a46a bridge-cli | ||
- name: Install optional additional packages | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y jq | ||
- name: Install Solana CLI and Anchor | ||
run: | | ||
sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)" | ||
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH" | ||
cargo install --git https://github.com/coral-xyz/anchor --tag v0.30.1 anchor-cli | ||
- name: Set up Docker | ||
uses: docker/setup-buildx-action@v2 |
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,82 @@ | ||
name: E2E Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
selected_pipelines: | ||
description: "Space-separated list of pipelines to run (e.g. 'bridge_token_near_to_evm another_pipeline')" | ||
required: false | ||
default: "bridge_token_near_to_evm" | ||
|
||
jobs: | ||
analyze-dependencies: | ||
name: Analyze Dependencies | ||
runs-on: ubuntu-latest | ||
outputs: | ||
common_deps: ${{ steps.get_deps.outputs.common_deps }} | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup E2E environment | ||
uses: ./.github/actions/e2e-setup | ||
|
||
- name: Parse input pipelines and create matrix | ||
id: set-matrix | ||
run: | | ||
# Convert space-separated input into JSON array for matrix | ||
PIPELINES="${{ github.event.inputs.selected_pipelines }}" | ||
JSON_ARRAY=$(echo "$PIPELINES" | jq -R -c 'split(" ")') | ||
echo "matrix={\"pipeline\":$JSON_ARRAY}" >> $GITHUB_OUTPUT | ||
- name: Get dependencies for each pipeline | ||
id: get_deps | ||
run: | | ||
COMMON_DEPS=$(./e2e-testing/tools/src/scripts/get_common_dependencies.sh ./e2e-testing/Makefile ${{ github.event.inputs.selected_pipelines }}) | ||
echo "common_deps=$COMMON_DEPS" >> $GITHUB_OUTPUT | ||
- name: Build common dependencies | ||
run: | | ||
echo "Building common dependencies" | ||
if [ -n "${{ steps.get_deps.outputs.common_deps }}" ]; then | ||
make ${{ steps.get_deps.outputs.common_deps }} | ||
fi | ||
- name: Upload common dependencies | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: common-dependencies | ||
path: | | ||
e2e-testing/generated/* | ||
run-tests: | ||
needs: analyze-dependencies | ||
name: Run ${{ matrix.pipeline }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: ${{fromJson(needs.analyze-dependencies.outputs.matrix)}} | ||
fail-fast: false | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup E2E environment | ||
uses: ./.github/actions/e2e-setup | ||
|
||
- name: Download common dependencies | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: common-dependencies | ||
|
||
- name: Run pipeline | ||
run: | | ||
echo "Running pipeline: ${{ matrix.pipeline }}" | ||
make ${{ matrix.pipeline }} | ||
- name: Upload test artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: e2e-test-results-${{ matrix.pipeline }} | ||
path: | | ||
e2e-testing/generated/*.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
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,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
makefile="$1" | ||
shift | ||
selected_pipelines="$@" | ||
|
||
if [ $(echo "$selected_pipelines" | wc -w) -eq 1 ]; then | ||
exit 0 | ||
fi | ||
|
||
for pipeline in $selected_pipelines; do | ||
make -f "$makefile" -nd "$pipeline" 2> /dev/null | \ | ||
grep -E 'Must remake target|File .* was considered already' | \ | ||
sed -E \ | ||
-e "s/.*Must remake target '([^']+)'.*/\1/" \ | ||
-e "s/.*File '([^']+)' was considered already.*/\1/" | uniq | ||
done | sort | uniq -c | awk -v count="$(echo "$selected_pipelines" | wc -w)" '$1 == count {print $2}' | paste -sd " " |