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

Split main workflow into build, lint and test workflows #1621

Merged
merged 1 commit into from
Sep 7, 2023
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
37 changes: 37 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge.
name: ci-build

# Trigger the workflow when:
on:
# A push occurs to one of the matched branches.
push:
branches:
- master
- stable/*
# Or when a pull request event occurs for a pull request against one of the
# matched branches.
pull_request:
branches:
- master
- stable/*

# Explicitly disable secrets.GITHUB_TOKEN permissions.
permissions: {}

jobs:
build:
# NOTE: This name appears in GitHub's Checks API.
name: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js 18
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build app
run: yarn build
44 changes: 44 additions & 0 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge.
buberdds marked this conversation as resolved.
Show resolved Hide resolved
name: ci-lint

# Trigger the workflow when:
on:
# A push occurs to one of the matched branches.
push:
branches:
- master
- stable/*
# Or when a pull request event occurs for a pull request against one of the
# matched branches.
pull_request:
branches:
- master
- stable/*

# Explicitly disable secrets.GITHUB_TOKEN permissions.
permissions: {}

jobs:
lint:
# NOTE: This name appears in GitHub's Checks API.
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js 18
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: ESLint
# Disallow warnings and always throw errors.
run: yarn lint --max-warnings 0
- name: Validate Grommet icons types
run: |
yarn fix-grommet-icons-types
git diff --exit-code
- name: Validate TypeScript
run: yarn checkTs
89 changes: 48 additions & 41 deletions .github/workflows/build-test.yaml → .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,53 @@
name: Build and test
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge.
buberdds marked this conversation as resolved.
Show resolved Hide resolved
name: ci-test

# Trigger the workflow when:
on:
# A push occurs to one of the matched branches.
push:
branches: [stable, master]
branches:
- master
- stable/*
# Or when a pull request event occurs for a pull request against one of the
# matched branches.
pull_request:
branches: [stable, master]
branches:
- master
- stable/*

# disable secrets.GITHUB_TOKEN permissions
# Explicitly disable secrets.GITHUB_TOKEN permissions.
permissions: {}

jobs:
yarn_cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js 18
uses: actions/setup-node@v3
id: yarn-cache
with:
node-version: 18
cache: 'yarn'
cache: yarn
- if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile

build:
needs: [yarn_cache]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: yarn lint --max-warnings 0
- run: |
yarn fix-grommet-icons-types
git diff --exit-code
- run: yarn checkTs
- run: yarn build

jest:
# NOTE: This name appears in GitHub's Checks API.
name: jest
needs: [yarn_cache]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- run: yarn install --frozen-lockfile
node-version: '18.x'
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- run: yarn test --coverage
- name: 'Upload coverage report'
uses: actions/upload-artifact@v3
Expand All @@ -61,16 +57,20 @@ jobs:
retention-days: 5

playwright:
# NOTE: This name appears in GitHub's Checks API.
name: playwright
needs: [yarn_cache]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- run: yarn install --frozen-lockfile
node-version: '18.x'
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- run: REACT_APP_E2E_TEST=1 yarn build:ext
- run: REACT_APP_E2E_TEST=1 yarn start:prod &
- name: Install playwright's npm dependencies
Expand All @@ -92,16 +92,20 @@ jobs:
retention-days: 5

cypress:
# NOTE: This name appears in GitHub's Checks API.
name: cypress
needs: [yarn_cache]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- run: yarn install --frozen-lockfile
node-version: '18.x'
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- run: docker-compose pull
- uses: satackey/[email protected]
# Ignore the failure of a step and avoid terminating the job.
Expand All @@ -118,10 +122,13 @@ jobs:
retention-days: 5

upload-coverage:
# NOTE: This name appears in GitHub's Checks API.
name: coverage
needs: [cypress, jest]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
- name: Download coverage reports
uses: actions/download-artifact@v3
- uses: codecov/codecov-action@v3
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Oasis Wallet

[![CI build status][github-ci-build-badge]][github-ci-build-link]
[![CI test status][github-ci-test-badge]][github-ci-test-link]
[![CI lint status][github-ci-lint-badge]][github-ci-lint-link]
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![codecov](https://codecov.io/gh/oasisprotocol/oasis-wallet-web/branch/master/graph/badge.svg)](https://codecov.io/gh/oasisprotocol/oasis-wallet-web)
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)
[![Build status](https://github.com/oasisprotocol/oasis-wallet-web/actions/workflows/build-test.yaml/badge.svg)](https://github.com/oasisprotocol/oasis-wallet-web/actions)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FEsya%2Foasis-wallet.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FEsya%2Foasis-wallet?ref=badge_shield)

> :warning: **NEVER use the private keys and mnemonics given as example in this repository.**

Expand Down Expand Up @@ -182,9 +183,10 @@ Transifex a few hours after changes are merged. After they are translated, click
_"i18n: Update translations from Transifex"_.

Adding a new language:

1. first add it to Transifex and translate the strings,
2. create a folder with the new language code in `src/locales` and download the
translation file there,
translation file there,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated due to MegaLinter Wrong amount of left-padding spaces(want multiple of 2)

3. add the new language to the [list of resources][i18n.ts]

## Preparing a Release
Expand All @@ -208,3 +210,9 @@ Adding a new language:
[useTranslation hook]: https://react.i18next.com/latest/usetranslation-hook
[English translation.json]: src/locales/en/translation.json
[i18n.ts]: src/locales/i18n.ts
[github-ci-build-badge]: https://github.com/oasisprotocol/oasis-wallet-web/actions/workflows/ci-build.yml/badge.svg
[github-ci-build-link]: https://github.com/oasisprotocol/oasis-wallet-web/actions?query=workflow:ci-build+branch:master
[github-ci-test-badge]: https://github.com/oasisprotocol/oasis-wallet-web/actions/workflows/ci-test.yml/badge.svg
[github-ci-test-link]: https://github.com/oasisprotocol/oasis-wallet-web/actions?query=workflow:ci-test+branch:master
[github-ci-lint-badge]: https://github.com/oasisprotocol/oasis-wallet-web/actions/workflows/ci-lint.yml/badge.svg
[github-ci-lint-link]: https://github.com/oasisprotocol/oasis-wallet-web/actions?query=workflow:ci-lint+branch:master