Merge branch 'feature/apex-bridge-ci' into feat/APEX-184-action-and-f… #7
Workflow file for this run
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
name: E2E ApexBridge Tests | |
on: # yamllint disable-line rule:truthy | |
push: | |
workflow_call: | |
outputs: | |
workflow_output: | |
description: E2E ApexBridge Tests output | |
value: ${{ jobs.apex.outputs.e2e_apex_output_failure }} | |
jobs: | |
e2e_apex_bridge: | |
name: Run E2E ApexBridge Tests | |
runs-on: ubuntu-latest | |
env: | |
E2E_TESTS: true | |
E2E_LOGS: true | |
CI_VERBOSE: true | |
outputs: | |
e2e_apex_output_failure: ${{ steps.run_e2e_apex_failure.outputs.test_output }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4.1.1 | |
- name: Install Go | |
uses: actions/setup-go@v5.0.0 | |
with: | |
go-version: 1.21.x | |
check-latest: true | |
- name: Generate OpenSSL certificate | |
run: openssl req -x509 -out localhost.crt -keyout localhost.key -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' -extensions EXT -config <(printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth") | |
- name: Copy certificate key | |
run: sudo cp localhost.key /etc/ssl/private/localhost.key | |
- name: Copy certificate itself | |
run: sudo cp localhost.crt /usr/local/share/ca-certificates/localhost.crt | |
- name: Add certificate to trusted list | |
run: sudo update-ca-certificates | |
- name: Update certificate key folder permissions | |
run: sudo chmod -R 755 /etc/ssl/private | |
- name: Update certificate key file permissions | |
run: sudo chmod 644 /etc/ssl/private/localhost.key | |
- name: Install Cardano tools | |
uses: milos-ethernal/cardano-node-action@5a3bce7266cc1500d96e8fa63b3bb97135988482 | |
- name: Install ogmios | |
uses: milos-ethernal/ogmios-action@13e2be0b00da80f26bb8583fa129bd7c08856a49 | |
- name: Verify PERSONAL_ACCESS_TOKEN | |
run: | | |
if [ -z "${{ secrets.PERSONAL_ACCESS_TOKEN }}" ]; then | |
echo "PERSONAL_ACCESS_TOKEN is not set" | |
exit 1 | |
else | |
echo "PERSONAL_ACCESS_TOKEN is set" | |
fi | |
- name: Checkout apex-bridge repo | |
uses: actions/checkout@v4.1.1 | |
with: | |
repository: Ethernal-Tech/apex-bridge | |
ref: main | |
token: ${{ secrets.APEX_ACCESS_TOKEN }} | |
- name: Build apex-bridge | |
run: | | |
go build | |
sudo mv apex-bridge /usr/local/bin/ | |
- name: Verify apex-bridge executable | |
run: apex-bridge --help | |
- name: Checkout blade | |
uses: actions/checkout@v4.1.1 | |
- name: Check certificate key permissions | |
run: ls -l /etc/ssl/private/localhost.key | |
- name: Run tests | |
run: make test-e2e-apex-bridge | |
- name: Run tests failed | |
if: failure() | |
id: run_e2e_apex_failure | |
run: echo "test_output=false" >> $GITHUB_OUTPUT | |
- name: Archive test logs | |
if: always() | |
uses: actions/upload-artifact@v4.3.0 | |
with: | |
name: e2e-apex-bridge-logs | |
path: e2e-logs-*/ | |
retention-days: 30 |