Skip to content

Commit

Permalink
Merge branch 'master' into Newly-Added-Attributes-Only-Visible
Browse files Browse the repository at this point in the history
  • Loading branch information
MirzaHanan authored Sep 26, 2024
2 parents 1c1a3fc + 0c354e2 commit cffe0eb
Show file tree
Hide file tree
Showing 104 changed files with 2,000 additions and 1,289 deletions.
65 changes: 51 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,40 @@ on:
branches:
- master
jobs:
get-cypress-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ./sphinx-nav-fiber

- name: Debug test files
working-directory: ./sphinx-nav-fiber
run: |
find cypress/e2e -name '*.spec.js' -o -name '*.cy.ts' | jq -R -s -c 'split("\n") | map(select(. != ""))'
- name: List Cypress test files
id: list-tests
working-directory: ./sphinx-nav-fiber
run: |
tests=$(find cypress/e2e -name '*.spec.js' -o -name '*.cy.ts' | jq -R -s -c 'split("\n") | map(select(. != ""))')
if [ -z "$tests" ]; then
echo "No Cypress test files found."
tests="[]"
fi
echo "::set-output name=tests::$tests"
outputs:
tests: ${{ steps.list-tests.outputs.tests }}

cypress-run:
runs-on: ubuntu-latest
needs: get-cypress-tests
strategy:
fail-fast: false
matrix:
file: ${{ fromJson(needs.get-cypress-tests.outputs.tests) }}
steps:
- name: Enable docker.host.internal for Ubuntu
run: |
Expand All @@ -17,8 +49,8 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
node-version-file: ".nvmrc"
cache: "yarn"
- name: Clone Stack
run: |
git clone https://github.com/stakwork/sphinx-stack.git stack
Expand Down Expand Up @@ -67,8 +99,8 @@ jobs:
- name: Copy Node.json
uses: canastro/copy-file-action@master
with:
source: 'stack/relay/NODES.json'
target: 'relay/nodes.json'
source: "stack/relay/NODES.json"
target: "relay/nodes.json"

- name: Install
run: yarn --immutable
Expand All @@ -81,28 +113,33 @@ jobs:
browser: chrome
headless: true
start: yarn run start-e2e
wait-on: 'http://localhost:3000' # Waits for above
spec: ${{ matrix.file }}
wait-on: "http://localhost:3000" # Waits for above
wait-on-timeout: 120 # Waits for 2 minutes
# Records to Cypress Dashboard
record: true
record: false
video: true
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# created by the GH Action automatically
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Component tests
run: yarn run cy-comp
continue-on-error: false
# - name: Component tests
# run: yarn run cy-comp
# continue-on-error: false

- name: Sanitize Test File Path
run: echo "SANITIZED_FILE=$(echo ${{ matrix.file }} | sed 's/\//_/g')" >> $GITHUB_ENV

- name: Debug sanitized file
run: echo "Sanitized file $SANITIZED_FILE"

- name: Upload Cypress logs
if: failure()
if: always()
uses: actions/upload-artifact@v4
with:
name: cypress-logs
name: "${{ env.SANITIZED_FILE }}-cypress-logs"
path: cypress/videos

- name: Check the coverage value
run: yarn test-coverage

- name: Stop Stack
working-directory: ./stack
run: docker compose down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cffe0eb

Please sign in to comment.