Skip to content

Commit

Permalink
Merge pull request #1387 from ChainSafe/dev
Browse files Browse the repository at this point in the history
Release Sharing and Storage to PROD
  • Loading branch information
FSM1 authored Aug 2, 2021
2 parents ae88827 + 5a17e17 commit fa99c60
Show file tree
Hide file tree
Showing 379 changed files with 23,266 additions and 6,911 deletions.
1 change: 0 additions & 1 deletion .env.example

This file was deleted.

8 changes: 6 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
"jsx": true // Allows for the parsing of JSX
}
},
"plugins": ["@typescript-eslint", "cypress"],
"plugins": ["@typescript-eslint", "cypress", "ternary"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:cypress/recommended"
"plugin:cypress/recommended",
"plugin:ternary/recommended"
],
"settings": {
"react": {
Expand Down Expand Up @@ -47,6 +48,9 @@
"comma-dangle": ["error", "never"],
"object-curly-spacing": ["error", "always"],
"space-in-parens": ["error", "never"],
"ternary/no-unreachable": "off",
"ternary/nesting": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
Expand Down
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: "Issue: Bug 🐛"
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to the website '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Console error**
If possible, please copy/paste or provide a screenshot of the browser console. To do so, press `Ctrl` + `Shift` + `J` (or `Cmd` + `Shift` + `J` on a Mac)

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
71 changes: 71 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ dev, prod ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ dev ]
schedule:
- cron: '45 17 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
38 changes: 38 additions & 0 deletions .github/workflows/lingui-extract-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lingui extract - Files
on:
pull_request:
branches:
- "dev"
paths:
- "packages/files-ui/**/*"
jobs:
# extract any new translatable string
# and commit if there are new ones
extract:
name: lingui-extract
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
ssh-key: ${{ secrets.LINGUI_GH_ACTION_COMMIT_KEY }}

- name: set user
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
# use node module caching
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: install packages
run: yarn install --immutable

- name: lingui-extract and commit
run: |
(cd packages/files-ui && yarn extract --clean)
git add packages/files-ui/src/locales/*
if git commit -m "lingui extract"; then git push; else echo 'exiting successfully without commit'; fi
38 changes: 38 additions & 0 deletions .github/workflows/lingui-extract-gaming.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lingui extract - Gaming
on:
pull_request:
branches:
- "dev"
paths:
- "packages/gaming-ui/**/*"
jobs:
# extract any new translatable string
# and commit if there are new ones
extract:
name: lingui-extract
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
ssh-key: ${{ secrets.LINGUI_GH_ACTION_COMMIT_KEY }}

- name: set user
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
# use node module caching
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: install packages
run: yarn install --immutable

- name: lingui-extract
run: |
(cd packages/gaming-ui && yarn extract --clean)
git add packages/gaming-ui/src/locales/*
if git commit -m "lingui extract"; then git push; else echo 'exiting successfully without commit'; fi
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Lingui extract
name: Lingui extract - Storage
on:
pull_request:
branches:
- "dev"
paths:
- "packages/storage-ui/**/*"
jobs:
# extract any new translatable string
# and commit if there are new ones
Expand All @@ -13,6 +15,7 @@ jobs:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
ssh-key: ${{ secrets.LINGUI_GH_ACTION_COMMIT_KEY }}

- name: set user
run: |
Expand All @@ -34,6 +37,6 @@ jobs:
env:
GITHUB_PACKAGES_AUTH_TOKEN: ${{ secrets.GH_PKG_AUTH_TOKEN }}
run: |
(cd packages/files-ui && yarn extract --clean)
git add packages/files-ui/src/locales/*
if git commit -m "lingui extract"; then git push --no-verify; else echo 'exiting successfully without commit'; fi
(cd packages/storage-ui && yarn extract --clean)
git add packages/storage-ui/src/locales/*
if git commit -m "lingui extract"; then git push; else echo 'exiting successfully without commit'; fi
6 changes: 0 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: set user
run: |
Expand All @@ -21,11 +19,7 @@ jobs:
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: install packages
env:
GITHUB_PACKAGES_AUTH_TOKEN: ${{ secrets.GH_PKG_AUTH_TOKEN }}
run: yarn install --immutable

- name: lint
env:
GITHUB_PACKAGES_AUTH_TOKEN: ${{ secrets.GH_PKG_AUTH_TOKEN }}
run: yarn lint
17 changes: 12 additions & 5 deletions .github/workflows/test.yml → .github/workflows/test-files.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
name: Cypress tests
on: pull_request
name: Cypress tests - Files
on:
pull_request:
paths:
- "packages/files-ui/**/*"
- "packages/common-components/**/*"
- "packages/common-theme/**/*"
- package.json
- .eslintrc.json
- tsconfig.json
jobs:
cypress-run:
runs-on: ubuntu-latest
container: cypress/browsers:node12.18.3-chrome87-ff82
container: cypress/browsers:node14.16.0-chrome90-ff88
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -15,7 +23,7 @@ jobs:
**/node_modules
~/.cache/Cypress
**/build
key: ${{ runner.os }}-node_modules-build-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-node_modules-files-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node_modules-build-
Expand All @@ -24,7 +32,6 @@ jobs:
- name: Cypress run
uses: cypress-io/github-action@v2
env:
GITHUB_PACKAGES_AUTH_TOKEN: ${{ secrets.GH_PKG_AUTH_TOKEN }}
REACT_APP_API_URL: ${{ secrets.GH_REACT_APP_API_URL }}
REACT_APP_BLOCKNATIVE_ID: ${{ secrets.GH_REACT_APP_BLOCKNATIVE_ID }}
REACT_APP_FILES_VERIFIER_NAME: ${{ secrets.GH_REACT_APP_FILES_VERIFIER_NAME }}
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/test-storage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Cypress tests - Storage
on:
pull_request:
paths:
- "packages/storage-ui/**/*"
- "packages/common-components/**/*"
- "packages/common-theme/**/*"
- package.json
- .eslintrc.json
- tsconfig.json
jobs:
cypress-run:
runs-on: ubuntu-latest
container: cypress/browsers:node14.16.0-chrome90-ff88
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: actions/cache@v2
id: yarn-build-cache
with:
path: |
**/node_modules
~/.cache/Cypress
**/build
key: ${{ runner.os }}-node_modules-build-storage-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node_modules-build-
# Install NPM dependencies, cache them correctly
# and run all Cypress tests
- name: Cypress run
uses: cypress-io/github-action@v2
env:
REACT_APP_API_URL: ${{ secrets.GH_REACT_APP_API_URL }}
REACT_APP_BLOCKNATIVE_ID: ${{ secrets.GH_REACT_APP_BLOCKNATIVE_ID }}
REACT_APP_FILES_VERIFIER_NAME: ${{ secrets.GH_REACT_APP_FILES_VERIFIER_NAME }}
REACT_APP_FILES_UUID_VERIFIER_NAME: 'chainsafe-uuid-testnet'
REACT_APP_TEST: 'true'
with:
start: yarn start:storage-ui
# quote the url to be safe against YML parsing surprises
wait-on: 'http://localhost:3000'
# wait for max 2 minutes for the storage-ui to respond
wait-on-timeout: 120
# custom test command to run
command: yarn test:ci:storage-ui
# store the screenshots if the tests fail
- name: Store screenshots
uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-screenshots
path: packages/storage-ui/cypress/screenshots
# store the videos if the tests fail
# - name: Store videos
# uses: actions/upload-artifact@v1
# if: failure()
# with:
# name: cypress-videos
# path: packages/storage-ui/cypress/videos
Loading

0 comments on commit fa99c60

Please sign in to comment.