forked from blockscout/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
84af34a
commit dbb07e2
Showing
1,071 changed files
with
22,633 additions
and
5,556 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 |
---|---|---|
@@ -0,0 +1,133 @@ | ||
name: Checks | ||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [ opened, synchronize, unlabeled ] | ||
paths-ignore: | ||
- '.github/ISSUE_TEMPLATE/**' | ||
- '.husky/**' | ||
- '.vscode/**' | ||
- 'deploy/**' | ||
- 'docs/**' | ||
- 'public/**' | ||
- 'stub/**' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
code_quality: | ||
name: Code quality | ||
runs-on: ubuntu-latest | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'WIP') && !(github.event.action == 'unlabeled' && github.event.label.name != 'WIP') }} | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'yarn' | ||
|
||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
id: cache-node-modules | ||
with: | ||
path: | | ||
node_modules | ||
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: yarn --frozen-lockfile | ||
|
||
- name: Run ESLint | ||
run: yarn lint:eslint | ||
|
||
- name: Compile TypeScript | ||
run: yarn lint:tsc | ||
|
||
jest_tests: | ||
name: Jest tests | ||
needs: [ code_quality ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'yarn' | ||
|
||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
id: cache-node-modules | ||
with: | ||
path: | | ||
node_modules | ||
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: yarn --frozen-lockfile | ||
|
||
- name: Run Jest | ||
run: yarn test:jest | ||
|
||
pw_tests: | ||
name: 'Playwright tests / Project: ${{ matrix.project }}' | ||
needs: [ code_quality ] | ||
runs-on: ubuntu-latest | ||
container: | ||
image: mcr.microsoft.com/playwright:v1.35.1-focal | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
project: [ default, mobile, dark-color-mode ] | ||
|
||
steps: | ||
- name: Install git-lfs | ||
run: apt-get update && apt-get install git-lfs | ||
|
||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
lfs: 'true' | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'yarn' | ||
|
||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
id: cache-node-modules | ||
with: | ||
path: | | ||
node_modules | ||
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: yarn --frozen-lockfile | ||
|
||
- name: Run PlayWright | ||
run: yarn test:pw:ci | ||
env: | ||
HOME: /root | ||
PW_PROJECT: ${{ matrix.project }} | ||
|
||
- name: Upload test results | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: playwright-report-${{ matrix.project }} | ||
path: playwright-report | ||
retention-days: 10 |
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,75 @@ | ||
name: Publish Docker image | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tags: | ||
description: Image tags | ||
required: false | ||
type: string | ||
platforms: | ||
description: Image platforms (you can specify multiple platforms separated by comma) | ||
required: false | ||
type: string | ||
default: linux/amd64 | ||
workflow_call: | ||
inputs: | ||
tags: | ||
description: Image tags | ||
required: false | ||
type: string | ||
platforms: | ||
description: Image platforms (you can specify multiple platforms separated by comma) | ||
required: false | ||
type: string | ||
default: linux/amd64 | ||
|
||
jobs: | ||
run: | ||
name: Run | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
# Will automatically make nice tags, see the table here https://github.com/docker/metadata-action#basic | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/blockscout/frontend | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Add SHORT_SHA env property with commit short sha | ||
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV | ||
|
||
- name: Debug | ||
env: | ||
REF_TYPE: ${{ github.ref_type }} | ||
REF_NAME: ${{ github.ref_name }} | ||
run: | | ||
echo "ref_type: $REF_TYPE" | ||
echo "ref_name: $REF_NAME" | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
cache-from: type=gha | ||
tags: ${{ inputs.tags || steps.meta.outputs.tags }} | ||
platforms: ${{ inputs.platforms }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: | | ||
GIT_COMMIT_SHA=${{ env.SHORT_SHA }} | ||
GIT_TAG=${{ github.ref_type == 'tag' && github.ref_name || '' }} |
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 |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
.DS_Store | ||
*.pem | ||
.tools | ||
grafana | ||
|
||
# debug | ||
npm-debug.log* | ||
|
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,27 @@ | ||
import type { Feature } from './types'; | ||
|
||
import { getEnvValue } from '../utils'; | ||
|
||
const apiHost = getEnvValue('NEXT_PUBLIC_METADATA_SERVICE_API_HOST'); | ||
|
||
const title = 'Address metadata'; | ||
|
||
const config: Feature<{ api: { endpoint: string; basePath: string } }> = (() => { | ||
if (apiHost) { | ||
return Object.freeze({ | ||
title, | ||
isEnabled: true, | ||
api: { | ||
endpoint: apiHost, | ||
basePath: '', | ||
}, | ||
}); | ||
} | ||
|
||
return Object.freeze({ | ||
title, | ||
isEnabled: false, | ||
}); | ||
})(); | ||
|
||
export default config; |
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,21 @@ | ||
import type { Feature } from './types'; | ||
|
||
import { getEnvValue } from '../utils'; | ||
|
||
const title = 'Data availability'; | ||
|
||
const config: Feature<{ isEnabled: true }> = (() => { | ||
if (getEnvValue('NEXT_PUBLIC_DATA_AVAILABILITY_ENABLED') === 'true') { | ||
return Object.freeze({ | ||
title, | ||
isEnabled: true, | ||
}); | ||
} | ||
|
||
return Object.freeze({ | ||
title, | ||
isEnabled: false, | ||
}); | ||
})(); | ||
|
||
export default config; |
Oops, something went wrong.