-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
485 changed files
with
28,890 additions
and
8,451 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
**/dist/ | ||
**/dist/ | ||
**.env |
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
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 |
---|---|---|
|
@@ -19,6 +19,10 @@ on: | |
type: string | ||
default: '/?network=mainnet' | ||
required: true | ||
testnet_network_value_for_e2e: | ||
type: string | ||
default: '/?network=sepolia' | ||
required: true | ||
publish_to_allure: #Here we define the variable that can be overwritten by caller workflow | ||
type: boolean | ||
description: "Publish test results to allure" | ||
|
@@ -58,7 +62,7 @@ jobs: | |
name: '${{ matrix.tags }}' | ||
container: | ||
image: mcr.microsoft.com/playwright:v1.27.0-focal | ||
options: --user root | ||
options: --user 1001 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
|
@@ -69,7 +73,7 @@ jobs: | |
with: | ||
node-version: '18' | ||
cache: 'npm' | ||
|
||
- name: Cache node modules | ||
id: cache-nodemodules | ||
uses: actions/cache@v3 | ||
|
@@ -104,33 +108,27 @@ jobs: | |
echo "Run tests" | ||
if [ "${{ matrix.tags }}" = "@testnetSmokeSuite" ]; then | ||
echo "Run in testnetSmokeSuite only" | ||
E2ENETWORK='/?network=goerli' npx cucumber-js --tags "${{ matrix.tags }} ${{ inputs.environmentTags }} and not @mainnet" | ||
E2ENETWORK='${{ inputs.testnet_network_value_for_e2e }}' npx cucumber-js --tags "${{ matrix.tags }} ${{ inputs.environmentTags }} and not @mainnet" | ||
else | ||
echo "Run in mainnet" | ||
E2ENETWORK='${{ inputs.default_network_value_for_e2e }}' npx cucumber-js --tags "${{ matrix.tags }} ${{ inputs.environmentTags }} and not @testnet" | ||
fi | ||
- name: Reset tags quotes | ||
- name: Save artifacts to Git | ||
if: always() | ||
run: | | ||
echo "MATRIX_TAG_WITHOUT_QUOTES=$(echo ${{ matrix.tags }} | sed -e 's/@//g' )" >> $GITHUB_ENV | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: allure-results | ||
path: packages/app/allure-results | ||
|
||
- name: Create launch ID | ||
- name: Upload test results to Allure reporter | ||
if: always() | ||
env: | ||
ALLURE_LAUNCH_NAME: "#${{ github.run_number }} ${{ env.MATRIX_TAG_WITHOUT_QUOTES }}" | ||
ALLURE_LAUNCH_TAGS: "${{ env.ALLURE_BASIC_TAGS }}, ${{ env.MATRIX_TAG_WITHOUT_QUOTES }}" | ||
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} | ||
run: | | ||
echo "ALLURE_LAUNCH_ID=$(./allurectl launch create --launch-name '${{ env.ALLURE_LAUNCH_NAME }}' --no-header --format ID | tail -n1)" >> $GITHUB_ENV | ||
- name: Upload tests to the Allure proj | ||
if: always() && inputs.publish_to_allure == true | ||
env: | ||
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} | ||
run: | | ||
./allurectl upload allure-results --launch-id ${{ env.ALLURE_LAUNCH_ID }} | ||
./allurectl launch close ${{ env.ALLURE_LAUNCH_ID }} | ||
./allurectl upload allure-results | ||
echo "*Public report link: https://raw.githack.com/matter-labs/block-explorer/gh-pages/${{ github.run_number }}/index.html" | ||
echo "*Public report link will be available when the 'Allure Report' job will be succesfully executed." | ||
- if: failure() | ||
name: Save artifacts | ||
|
@@ -140,18 +138,53 @@ jobs: | |
path: packages/app/tests/e2e/artifacts/* | ||
|
||
publish: | ||
name: Publish Allure link to GIT | ||
name: Allure Report | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
contents: write | ||
needs: e2e | ||
if: always() | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: allure-results | ||
path: packages/app/allure-results | ||
|
||
- name: Get Allure history | ||
uses: actions/checkout@v3 | ||
if: always() | ||
continue-on-error: true | ||
with: | ||
ref: gh-pages | ||
path: gh-pages | ||
|
||
- name: Allure Report action from marketplace | ||
uses: simple-elf/[email protected] | ||
if: always() | ||
id: allure-report | ||
with: | ||
allure_results: packages/app/allure-results | ||
gh_pages: gh-pages | ||
allure_report: allure-report | ||
allure_history: allure-history | ||
keep_reports: 10 | ||
|
||
- name: Deploy report to Github Pages | ||
if: always() | ||
uses: peaceiris/actions-gh-pages@v2 | ||
env: | ||
PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PUBLISH_BRANCH: gh-pages | ||
PUBLISH_DIR: allure-history | ||
|
||
- name: Prepare a link | ||
run: | | ||
echo "BASE64_SEARCH_REQUEST=$(echo '${{ env.ALLURE_SEARCH_REQUEST }}' | base64)" >> $GITHUB_ENV | ||
- name: Publish Allure link to GIT Summary | ||
run: | | ||
LINK="${{ vars.ALLURE_ENDPOINT }}project/${{ vars.ALLURE_PROJECT_ID }}/launches?search=${{ env.BASE64_SEARCH_REQUEST }}" | ||
echo "Allure [e2e tests]($LINK) :rocket: in git run #${{ github.run_number }}" >> $GITHUB_STEP_SUMMARY | ||
LINK1="${{ vars.ALLURE_ENDPOINT }}project/${{ vars.ALLURE_PROJECT_ID }}/launches?search=${{ env.BASE64_SEARCH_REQUEST }}" | ||
LINK2="https://raw.githack.com/matter-labs/block-explorer/gh-pages/${{ github.run_number }}/index.html" | ||
echo "Allure [Private]($LINK1) and [Public]($LINK2) links:rocket: in git run #${{ github.run_number }}" >> $GITHUB_STEP_SUMMARY |
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,61 @@ | ||
name: Integration test - API | ||
on: pull_request | ||
|
||
jobs: | ||
runTests: | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
checks: write | ||
strategy: | ||
matrix: | ||
node-version: ['lts/*'] # 18.17.1 or lts/* | ||
test-pattern: | ||
- accounts.test.ts | ||
- addresses.test.ts | ||
- batches.test.ts | ||
- blocks.test.ts | ||
- contracts.test.ts | ||
- logs.test.ts | ||
- stats.test.ts | ||
- tokens.test.ts | ||
- transactions.test.ts | ||
name: 'API test set: ${{ matrix.test-pattern}} / Node: ${{ matrix.node-version}}' | ||
steps: | ||
- name: Checkout with Submodule | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: npm | ||
|
||
- name: Install dependencies | ||
run: | | ||
npm ci --no-audit | ||
npx playwright install --with-deps chromium | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USER }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Start docker containers | ||
run: | | ||
docker-compose -f "docker-compose.yaml" up -d --build | ||
- name: List running containers | ||
run: docker ps | ||
|
||
- name: API tests run (parallel) | ||
run: | | ||
cd packages/integration-tests | ||
npx jest --verbose --testPathPattern=${{ matrix.test-pattern }} | ||
- name: Stop containers | ||
if: always() | ||
run: | | ||
docker-compose -f "docker-compose.yaml" down |
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
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,4 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"editor.tabSize": 2 | ||
} |
Oops, something went wrong.