Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/gltf support #5100

Merged
merged 22 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Contributing

Anyone is welcome to help make Leather better. We encourage contributors to let us know via Github issues what they’d like to work on. We’re happy to help get you started.

Leather aims to respond to contributor PRs within 2 working days.

## Bugs

If you’ve found a bug, first check to see if an issue already exists. If so, add a comment to let us know you found it too. Otherwise, open up an issue describing in as much detail as possible how we’d be able to recreate it.

If you’re a developer, feel free to submit a Pull Request with a suggested fix.

## Feature enhancements

There is a long list of features we want to add to Leather, and we’d love help working on them. Please be aware, your work will only be merged if it aligns with Leather’s product roadmap and conforms to Leather’s standards.

## Coding standards

Code contributions must follow the style and patterns already employed by the project. This list of requirements is non-exhaustive. The Leather team might ask for additional changes.

- Code must conform to our linting setup `pnpm lint`
- Code formatting correctly `pnpm prettier`
- Code must be typed properly with Typescript `pnpm typecheck`

## Testing

Code should be tested thoroughly. Complex logic must be unit tested. User flows should be covered with integration tests using [Playwright](https://playwright.dev/).

## Support

The Leather team is happy to help. If you need more involved guidance for your contribution, please allow some additional time for the team to respond to your queries.
2 changes: 1 addition & 1 deletion .github/actions/check-version-lock/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Check package version lock'
description: Checks all versions are installed with exact version
runs:
using: 'node16'
using: 'node20'
main: 'check-version-lock.js'
25 changes: 15 additions & 10 deletions .github/actions/provision/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,30 @@ runs:
using: 'composite'
steps:
- name: Set up node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18

- uses: actions/cache@v3
- name: Set up pnpm
uses: pnpm/action-setup@v3

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- uses: actions/cache@v4
id: cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- uses: nick-fields/retry@v2
if: steps.cache.outputs.cache-hit != 'true'
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
with:
timeout_minutes: 5
max_attempts: 3
command: yarn --frozen-lockfile

- name: Pandacodegen
run: yarn panda codegen
shell: bash
command: pnpm install --frozen-lockfile
26 changes: 23 additions & 3 deletions .github/workflows/build-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- uses: kyranjamie/[email protected]
with:
header: '> _Building Leather at commit `${{ env.SHORT_SHA }}`_'
header: '> _Building Leather at commit ${{ env.SHORT_SHA }}_'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build:
Expand All @@ -42,7 +42,7 @@ jobs:
- run: echo "SHORT_SHA=`echo ${{ github.event.pull_request.head.sha }} | cut -c1-7`" >> $GITHUB_ENV

- name: Build project
run: yarn build
run: pnpm build
env:
WALLET_ENVIRONMENT: feature
TARGET_BROWSER: ${{ matrix.target }}
Expand All @@ -61,12 +61,32 @@ jobs:
name: leather-${{ matrix.target }}-${{ env.SHORT_SHA }}
path: dist

chromatic:
runs-on: ubuntu-latest
outputs:
storybook_url: ${{ steps.chromatic.outputs.storybookUrl }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: ./.github/actions/provision

- name: Deploy to Chromatic
id: chromatic
uses: chromaui/action@latest
with:
autoAcceptChanges: 'main'
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}

set-download-link:
if: github.repository == 'leather-wallet/extension' && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
needs:
- pre-run
- build
- chromatic
steps:
- name: Extract branch name
shell: bash
Expand All @@ -75,5 +95,5 @@ jobs:

- uses: kyranjamie/[email protected]
with:
header: '> Try out this version of Leather — [Extension build](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}), [Test report](https://leather-wallet.github.io/playwright-reports/${{ steps.extract_branch.outputs.branch }})'
header: '> Try out this version of Leather — [Extension build](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}), [Test report](https://leather-wallet.github.io/playwright-reports/${{ steps.extract_branch.outputs.branch }}), [Storybook preview](${{ needs.chromatic.outputs.storybook_url }})'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 0 additions & 18 deletions .github/workflows/chromatic.yml

This file was deleted.

24 changes: 12 additions & 12 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Lint
run: yarn lint:prettier
run: pnpm lint:prettier

lint-eslint:
runs-on: ubuntu-latest
Expand All @@ -23,7 +23,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Lint
run: yarn lint:eslint
run: pnpm lint:eslint

lint-filename:
runs-on: ubuntu-latest
Expand All @@ -32,7 +32,7 @@ jobs:
- uses: ./.github/actions/provision

- name: File name checker
run: yarn lint:filename
run: pnpm lint:filename

lint-commit:
runs-on: ubuntu-latest
Expand All @@ -51,7 +51,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Lint dependency rules
run: yarn lint:deps
run: pnpm lint:deps

lint-message-schema:
runs-on: ubuntu-latest
Expand All @@ -60,7 +60,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Validate message schema
run: yarn lint:remote-wallet-config
run: pnpm lint:remote-wallet-config

lint-unused-exports:
runs-on: ubuntu-latest
Expand All @@ -69,19 +69,19 @@ jobs:
- uses: ./.github/actions/provision

- name: Lint unused TypeScript exports
run: yarn lint:unused-exports
run: pnpm lint:unused-exports

lint-firefox-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/provision

- run: yarn build
- run: pnpm build
env:
TARGET_BROWSER: firefox

- run: yarn web-ext lint
- run: pnpm web-ext lint

locked-versions:
runs-on: ubuntu-latest
Expand All @@ -99,7 +99,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Audit
run: yarn audit-ci --high --skip-dev
run: pnpm audit-ci --high --skip-dev

typecheck:
runs-on: ubuntu-latest
Expand All @@ -108,7 +108,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Typecheck
run: yarn typecheck
run: pnpm typecheck

test-unit:
runs-on: ubuntu-latest
Expand All @@ -117,7 +117,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Test
run: yarn test:unit
run: pnpm test:unit

test-build:
runs-on: ubuntu-latest
Expand All @@ -126,7 +126,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Build
run: yarn build
run: pnpm build

- name: Package extension
run: sh build-ext.sh
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/contributor-advice.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Contributor automation

on:
pull_request:
types: opened

jobs:
fork-detection:
runs-on: ubuntu-latest
permissions:
issues: write
# When a fork
if: github.event.pull_request.head.repo.full_name != github.repository && github.actor != 'dependabot[bot]'
steps:
- name: Add contributor advice
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
token: ${{ secrets.LEATHER_BOT }}
body: |
Thanks for contributing to Leather! Our team will review your PR and get back to you as soon as possible.

Please make sure to follow our [Contributor Guidelines][1]

[1]: https://github.com/leather-wallet/extension/tree/dev/.github/CONTRIBUTING.md

- name: Add label
run: gh issue edit "$NUMBER" --add-label "$LABELS"
env:
GH_TOKEN: ${{ secrets.LEATHER_BOT }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.pull_request.number }}
LABELS: 'needs:internal-review'
4 changes: 2 additions & 2 deletions .github/workflows/create-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
paths-ignore:
- '**/CHANGELOG.md'
- '**/package.json'
- '**/yarn.lock'
- '**/pnpm-lock.yaml'
- './config/**'
- 'README.md'

Expand All @@ -29,7 +29,7 @@ jobs:
token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
- uses: ./.github/actions/provision

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/development-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Build project
env:
IS_PUBLISHING: true
run: yarn build
run: pnpm build

- uses: actions/upload-artifact@v3
name: Upload build artifact
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/external-api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,43 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/provision
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18

- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: yarn --frozen-lockfile
run: pnpm install --frozen-lockfile
shell: bash

- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV

- name: Cache playwright binaries
uses: actions/cache@v3
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}

- name: Install Playwright deps
run: yarn playwright install chrome
run: pnpm playwright install chrome
if: steps.playwright-cache.outputs.cache-hit != 'true'

- name: Run Playwright tests
id: playwright
uses: mathiasvr/[email protected]
with:
run: yarn playwright test --reporter=github tests/api
run: pnpm playwright test --reporter=github tests/api

- name: Truncate String
uses: 2428392/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: ./.github/actions/provision

- name: Build
run: yarn test:coverage
run: pnpm test:coverage

- name: Make badge maker
run: npx make-coverage-badge
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/notify-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 14.x
- name: Get latest Chrome version
Expand Down
Loading
Loading