Skip to content

Commit

Permalink
Trigger tests (#677)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrijeDragasevic authored Dec 3, 2024
1 parent 5834145 commit 3ada7ab
Showing 1 changed file with 61 additions and 2 deletions.
63 changes: 61 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
./andromeda-deploy
trigger-schema-parser:
needs: [deploy, build_schemas]
needs: [deploy]
runs-on: ubuntu-latest
steps:
- name: Set Branch Based on Kernel
Expand Down Expand Up @@ -176,4 +176,63 @@ jobs:
git push
else
echo "No changes to commit"
fi
fi
trigger-armour-workflow:
needs: [trigger-schema-parser]
runs-on: ubuntu-latest
steps:
- name: Wait for schema updates
run: |
echo "Waiting 6 minutes for schema updates to propagate..."
sleep 360
echo "Wait complete, proceeding with Armor workflow trigger"
- name: Download version-map
uses: actions/download-artifact@v4
with:
name: contracts
path: "artifacts"

- name: Extract version map
run: |
cd artifacts
cat version_map.json
cp version_map.json ../version_map.json
- name: Trigger Armor Workflow
uses: actions/github-script@v7
with:
github-token: ${{ secrets.CI_PAT }}
script: |
const kernelAddress = '${{ inputs.kernel_address }}';
const testnetKernels = '${{ vars.TESTNET_KERNELS }}';
const testnetStagingKernels = '${{ vars.TESTNET_STAGING_KERNELS }}';
// Read the version map
const fs = require('fs');
const versionMap = fs.readFileSync('version_map.json', 'utf8');
let workflowFile;
if (kernelAddress === testnetKernels) {
workflowFile = 'develop.yml';
} else if (kernelAddress === testnetStagingKernels) {
workflowFile = 'staging.yml';
} else {
core.setFailed('Error: Kernel not found in known configurations');
return;
}
try {
await github.rest.actions.createWorkflowDispatch({
owner: 'andromedaprotocol',
repo: 'andromeda-armour',
workflow_id: workflowFile,
ref: 'main',
inputs: {
version_map: versionMap
}
});
} catch (error) {
core.setFailed(`Failed to trigger Armor workflow: ${error.message}`);
}

0 comments on commit 3ada7ab

Please sign in to comment.