Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:lukso-network/wallet.universalpr…
Browse files Browse the repository at this point in the history
…ofile.cloud into feat/profile-fetching-DEV-6309
  • Loading branch information
dzbo committed Aug 4, 2023
2 parents b08ed77 + 9883325 commit 720459c
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 5 deletions.
91 changes: 88 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,113 @@
name: Tests
name: Lint, Test, Build

on:
pull_request:
branches:
- '*'
- 'main'
- 'develop'
push:
branches:
- 'main'
- 'develop'

env:
CF_PROJECT_NAME: wallet-universalprofile-cloud
CF_BASE_URL: wallet-universalprofile-cloud

jobs:
test:
timeout-minutes: 60
runs-on: macos-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 16
node-version: '18.17.0'
cache: 'yarn'

- name: ⚙️ Install dependencies
run: yarn install

- name: 🎨 Lint
run: yarn lint

- name: 🛠 Install Playwright Browsers
run: npx playwright install --with-deps chromium

- name: 🎯 Run Playwright tests
run: npx playwright test

- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30

build-lint-test:
runs-on: ubuntu-latest
needs: test

steps:
- name: Extract branch name
shell: bash
run: |
PR_NUMBER="${{ github.event.number }}"
if [ -n "$PR_NUMBER" ]
then
echo "branch_name=pr-${PR_NUMBER}" >> $GITHUB_OUTPUT
echo "url=https://pr-${PR_NUMBER}.${{ env.CF_BASE_URL }}.pages.dev" >> $GITHUB_OUTPUT
else
if [ "${{ github.ref }}" = "refs/heads/develop" ]
then
echo "branch_name=develop" >> $GITHUB_OUTPUT
echo "url=https://develop.${{ env.CF_BASE_URL }}.pages.dev" >> $GITHUB_OUTPUT
else
echo "branch_name=" >> $GITHUB_OUTPUT
fi
fi
id: extract_branch

- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: '18.17.0'
cache: 'yarn'

- name: Install
run: yarn install

- name: Build
run: yarn run pages:build

- name: 'Deploy release'
if: ${{ steps.extract_branch.outputs.branch_name == '' }}
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: pages deploy --project-name "${{ env.CF_PROJECT_NAME }}" dist

- name: Deploy ${{ steps.extract_branch.outputs.branch_name }} (PR)
if: ${{ steps.extract_branch.outputs.branch_name != '' }}
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: pages deploy --project-name "${{ env.CF_PROJECT_NAME }}" dist --branch "${{ steps.extract_branch.outputs.branch_name }}" | tee output.log
postCommands: |
sed < output.log -n 's#.*Take a peek over at \(.*\)$#specific_url=\1#p' >> $GITHUB_OUTPUT
id: deploy

- name: Create commit comment
uses: mshick/add-pr-comment@v2
if: ${{ steps.extract_branch.outputs.branch_name != '' }}
with:
message: |
### Deployed with **Cloudflare Pages** :cloud: :rocket: :ok:
- **URL**: [${{ steps.extract_branch.outputs.url }}](${{ steps.extract_branch.outputs.url }})
- **Specific**: [${{ steps.deploy.outputs.specific_url }}](${{ steps.deploy.outputs.specific_url }})
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.17.0
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"yata-fetch": "dotenv -- yata-fetch --config .yata.json",
"test": "npx playwright test",
"test:ui": "npx playwright test --ui",
"test:debug": "npx playwright test --debug"
"test:debug": "npx playwright test --debug",
"pages:build": "cross-env NODE_ENV=production NITRO_PRESET=cloudflare_pages nuxt build --standalone"
},
"devDependencies": {
"@erc725/erc725.js": "^0.18.0",
Expand Down Expand Up @@ -86,5 +87,8 @@
"prettier --list-different",
"stylelint"
]
},
"dependencies": {
"cross-env": "^7.0.3"
}
}
15 changes: 14 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5097,6 +5097,18 @@ __metadata:
languageName: node
linkType: hard

"cross-env@npm:^7.0.3":
version: 7.0.3
resolution: "cross-env@npm:7.0.3"
dependencies:
cross-spawn: ^7.0.1
bin:
cross-env: src/bin/cross-env.js
cross-env-shell: src/bin/cross-env-shell.js
checksum: 26f2f3ea2ab32617f57effb70d329c2070d2f5630adc800985d8b30b56e8bf7f5f439dd3a0358b79cee6f930afc23cf8e23515f17ccfb30092c6b62c6b630a79
languageName: node
linkType: hard

"cross-fetch@npm:^2.1.0":
version: 2.2.6
resolution: "cross-fetch@npm:2.2.6"
Expand Down Expand Up @@ -5129,7 +5141,7 @@ __metadata:
languageName: node
linkType: hard

"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3":
"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.1, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3":
version: 7.0.3
resolution: "cross-spawn@npm:7.0.3"
dependencies:
Expand Down Expand Up @@ -15850,6 +15862,7 @@ __metadata:
"@typescript-eslint/eslint-plugin": 6.2.1
"@typescript-eslint/parser": 6.2.1
buffer: 6.0.3
cross-env: ^7.0.3
dotenv-cli: 7.2.1
eslint: 8.46.0
eslint-config-prettier: 8.10.0
Expand Down

0 comments on commit 720459c

Please sign in to comment.