Commit cc919ab3 authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

build: optimize github actions (#3922)

* build: parallelize cypress

- Parallelizes cypress CI runs
- Cleans up CI workflow files

* build: fix typo

* build: cache node_modules

* build: cache node_modules everywhere

* fix: action/cache usage

* fix: do not cache dynamically built files

* build: use standard container for cypress

* fix: cache cypress

* fix: cache cypress
parent 53d6eb09
...@@ -13,23 +13,26 @@ jobs: ...@@ -13,23 +13,26 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - uses: actions/checkout@v3
uses: actions/checkout@v3
- name: Set up node - uses: actions/setup-node@v3
uses: actions/setup-node@v3
with: with:
node-version: 14 node-version: 14
registry-url: https://registry.npmjs.org registry-url: https://registry.npmjs.org
cache: 'yarn' cache: 'yarn'
- name: Install dependencies - uses: actions/cache@v3
run: yarn install --frozen-lockfile id: install-cache
with:
path: node_modules/
key: ${{ runner.os }}-install-${{ hashFiles('**/yarn.lock') }}
- if: steps.install-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --ignore-scripts
- name: Extract translations - run: yarn i18n:extract
run: "yarn i18n:extract"
- name: Synchronize - name: Download Crowdin translations
uses: crowdin/github-action@1.4.9 uses: crowdin/github-action@1.4.9
with: with:
upload_sources: false upload_sources: false
......
...@@ -11,23 +11,26 @@ jobs: ...@@ -11,23 +11,26 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - uses: actions/checkout@v3
uses: actions/checkout@v3
- name: Set up node - uses: actions/setup-node@v3
uses: actions/setup-node@v3
with: with:
node-version: 14 node-version: 14
registry-url: https://registry.npmjs.org registry-url: https://registry.npmjs.org
cache: 'yarn' cache: 'yarn'
- name: Install dependencies - uses: actions/cache@v3
run: yarn install --frozen-lockfile id: install-cache
with:
path: node_modules/
key: ${{ runner.os }}-install-${{ hashFiles('**/yarn.lock') }}
- if: steps.install-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --ignore-scripts
- name: Extract translations - run: yarn i18n:extract
run: "yarn i18n:extract"
- name: Synchronize - name: Upload Crowdin sources
uses: crowdin/github-action@1.1.0 uses: crowdin/github-action@1.1.0
with: with:
upload_sources: true upload_sources: true
......
...@@ -14,18 +14,22 @@ jobs: ...@@ -14,18 +14,22 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - uses: actions/checkout@v3
uses: actions/checkout@v3
- name: Set up node - uses: actions/setup-node@v3
uses: actions/setup-node@v3
with: with:
node-version: 14 node-version: 14
registry-url: https://registry.npmjs.org registry-url: https://registry.npmjs.org
cache: 'yarn' cache: 'yarn'
- name: Install dependencies - uses: actions/cache@v3
run: yarn install --frozen-lockfile id: install-cache
with:
path: node_modules/
key: ${{ runner.os }}-install-${{ hashFiles('**/yarn.lock') }}
- if: steps.install-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --ignore-scripts
- name: Run eslint w/ autofix - name: Run eslint w/ autofix
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner }} if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner }}
......
...@@ -14,8 +14,7 @@ jobs: ...@@ -14,8 +14,7 @@ jobs:
new_tag: ${{ steps.github_tag_action.outputs.new_tag }} new_tag: ${{ steps.github_tag_action.outputs.new_tag }}
changelog: ${{ steps.github_tag_action.outputs.changelog }} changelog: ${{ steps.github_tag_action.outputs.changelog }}
steps: steps:
- name: Checkout - uses: actions/checkout@v3
uses: actions/checkout@v3
- name: Bump version and push tag - name: Bump version and push tag
id: github_tag_action id: github_tag_action
...@@ -31,21 +30,26 @@ jobs: ...@@ -31,21 +30,26 @@ jobs:
needs: bump_version needs: bump_version
if: ${{ needs.bump_version.outputs.new_tag != null }} if: ${{ needs.bump_version.outputs.new_tag != null }}
steps: steps:
- name: Checkout - uses: actions/checkout@v3
uses: actions/checkout@v3
- name: Set up node - uses: actions/setup-node@v3
uses: actions/setup-node@v3
with: with:
node-version: 14 node-version: 14
registry-url: https://registry.npmjs.org registry-url: https://registry.npmjs.org
cache: 'yarn' cache: 'yarn'
- name: Install dependencies - uses: actions/cache@v3
run: yarn install --frozen-lockfile id: install-cache
with:
path: node_modules/
key: ${{ runner.os }}-install-${{ hashFiles('**/yarn.lock') }}
- if: steps.install-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --ignore-scripts
- run: yarn prepare
- name: Build the IPFS bundle - run: yarn build
run: yarn build
- name: Pin to IPFS - name: Pin to IPFS
id: upload id: upload
......
...@@ -9,21 +9,94 @@ on: ...@@ -9,21 +9,94 @@ on:
- main - main
jobs: jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
registry-url: https://registry.npmjs.org
cache: 'yarn'
- uses: actions/cache@v3
id: install-cache
with:
path: node_modules/
key: ${{ runner.os }}-install-${{ hashFiles('**/yarn.lock') }}
- if: steps.install-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --ignore-scripts
- run: yarn prepare
- run: yarn build
- uses: actions/upload-artifact@v2
with:
name: build
path: build
if-no-files-found: error
- uses: actions/cache@v3
id: cypress-cache
with:
path: /home/runner/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('node_modules/cypress') }}
- if: steps.cypress-cache.outputs.cache-hit != 'true'
run: yarn cypress install
cypress-tests: cypress-tests:
name: Run Cypress tests name: Run tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4]
steps: steps:
- name: Checkout - uses: actions/checkout@v3
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
registry-url: https://registry.npmjs.org
cache: 'yarn'
- uses: actions/cache@v3
id: install-cache
with:
path: node_modules/ # this should always be a cache hit, from install
key: ${{ runner.os }}-install-${{ hashFiles('**/yarn.lock') }}
- if: steps.install-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --ignore-scripts
- uses: actions/download-artifact@v2
with:
name: build
path: build
- uses: actions/cache@v3
id: cypress-cache
with:
path: /home/runner/.cache/Cypress
key: ${{ runner.os }}-cypress-${{ hashFiles('node_modules/cypress') }}
- if: steps.cypress-cache.outputs.cache-hit != 'true'
run: yarn cypress install
- name: Cypress install - uses: cypress-io/github-action@v4
uses: cypress-io/github-action@v4
with: with:
build: yarn build install: false
start: yarn serve start: yarn serve
wait-on: 'http://localhost:3000' wait-on: 'http://localhost:3000'
browser: chrome browser: chrome
record: true record: true
parallel: true
env: env:
CI: false # disables lint checks when building CI: false # disables lint checks when building
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
......
...@@ -13,18 +13,23 @@ jobs: ...@@ -13,18 +13,23 @@ jobs:
name: Run tests name: Run tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - uses: actions/checkout@v3
uses: actions/checkout@v3
- name: Set up node - uses: actions/setup-node@v3
uses: actions/setup-node@v3
with: with:
node-version: 14 node-version: 14
registry-url: https://registry.npmjs.org registry-url: https://registry.npmjs.org
cache: 'yarn' cache: 'yarn'
- name: Install dependencies - uses: actions/cache@v3
run: yarn install --frozen-lockfile id: install-cache
with:
path: node_modules/
key: ${{ runner.os }}-install-${{ hashFiles('**/yarn.lock') }}
- if: steps.install-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --ignore-scripts
- run: yarn prepare
- name: Run unit tests - run: yarn test
run: yarn test
...@@ -3,9 +3,6 @@ ...@@ -3,9 +3,6 @@
# generated contract types # generated contract types
/src/types/v3 /src/types/v3
/src/abis/types /src/abis/types
/src/lib/locales/**/*.js
/src/lib/locales/**/en-US.po
/src/lib/locales/**/pseudo.po
/src/locales/**/*.js /src/locales/**/*.js
/src/locales/**/en-US.po /src/locales/**/en-US.po
/src/locales/**/pseudo.po /src/locales/**/pseudo.po
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment