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

build: add firefox add-on linting #23

Merged
merged 10 commits into from
Nov 17, 2023
Merged
22 changes: 22 additions & 0 deletions .github/actions/use-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Use Dependencies"

description: "Checks if the dependencies have been cached with the hash of the yarn.lock file."

runs:
using: "composite"
steps:
- name: "πŸ”§ Setup"
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'yarn'
- name: "πŸ’Ύ Cache dependencies"
uses: actions/cache@v3
id: cache-dependencies
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('yarn.lock') }}
- name: "πŸ“¦ Install"
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: yarn install --ignore-scripts
shell: bash
24 changes: 0 additions & 24 deletions .github/workflows/lint_build_test.yml

This file was deleted.

99 changes: 99 additions & 0 deletions .github/workflows/pull_request_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: "Pull Request Checks"

on:
pull_request:

jobs:
install:
name: "Install"
runs-on: ubuntu-latest
steps:
- name: "πŸ›Ž Checkout"
uses: actions/checkout@v3
- name: "πŸ”§ Setup"
uses: ./.github/actions/use-dependencies

##
# needs install
##

lint:
name: "Lint"
needs: install
runs-on: ubuntu-latest
steps:
- name: "πŸ›Ž Checkout"
uses: actions/checkout@v3
- name: "πŸ”§ Setup"
uses: ./.github/actions/use-dependencies
- name: "πŸ‘• Lint"
run: yarn lint

build:
name: "Build"
needs: install
runs-on: ubuntu-latest
steps:
- name: "πŸ›Ž Checkout"
uses: actions/checkout@v3
- name: "πŸ”§ Setup"
uses: ./.github/actions/use-dependencies
- name: "πŸ—οΈ Build"
run: yarn build
- name: "πŸ—œοΈ Zip build"
run: zip -r build.zip .build/
- name: "πŸ“€ Upload build"
uses: actions/upload-artifact@v3
with:
name: build
path: build.zip

test:
name: "Test"
needs: install
runs-on: ubuntu-latest
steps:
- name: "πŸ›Ž Checkout"
uses: actions/checkout@v3
- name: "πŸ”§ Setup"
uses: ./.github/actions/use-dependencies
- name: "πŸ§ͺ Test"
run: yarn test

##
# needs [install, build]
##

validate_firefox:
name: "Validate Firefox"
needs: [install, build]
runs-on: ubuntu-latest
steps:
- name: "πŸ›Ž Checkout"
uses: actions/checkout@v3
- name: "πŸ”§ Setup"
uses: ./.github/actions/use-dependencies
- name: "πŸ“₯ Download build"
uses: actions/download-artifact@v3
with:
name: build
- name: "πŸ—œοΈ Unzip build"
run: unzip build.zip
- name: "βœ… Validate"
run: yarn validate:firefox

##
# needs validate_firefox
##

clean_up:
name: "Clean Up"
needs: validate_firefox
runs-on: ubuntu-latest
steps:
- name: "πŸ—‘οΈ Delete artifacts"
uses: geekyeggo/delete-artifact@v2
with:
failOnError: false
name: |
build
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"start:extension": "cross-env TS_NODE_PROJECT=\"webpack/tsconfig.webpack.json\" webpack --config webpack/webpack.config.ts --config-name development --watch",
"start:dapp": "cross-env TS_NODE_PROJECT=\"webpack/tsconfig.webpack.json\" webpack serve --config webpack/webpack.config.ts --config-name dapp",
"start:firefox": "web-ext run",
"test": "jest"
"test": "jest",
"validate:firefox": "addons-linter .build/"
},
"devDependencies": {
"@commitlint/cli": "^17.4.4",
Expand All @@ -61,6 +62,7 @@
"@walletconnect/types": "^2.8.0",
"@web3modal/sign-react": "^2.4.5",
"add": "^2.0.6",
"addons-linter": "^6.17.0",
"concurrently": "^7.6.0",
"copy-webpack-plugin": "^11.0.0",
"cross-env": "^7.0.3",
Expand Down
2 changes: 1 addition & 1 deletion webpack/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const configs: (Configuration | DevelopmentConfiguration)[] = [
* production
*/
merge(commonConfig, {
devtool: 'source-map',
devtool: false,

mode: 'production',

Expand Down
Loading
Loading