Skip to content

build: add firefox add-on linting #3

build: add firefox add-on linting

build: add firefox add-on linting #3

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: 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
##
# needs install
##
lint:
name: "Lint"
needs: install
runs-on: ubuntu-latest
steps:
- name: "🛎 Checkout"
uses: actions/checkout@v3
- name: "🔧 Setup"
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'yarn'
- name: "💾 Cache dependencies"
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('yarn.lock') }}
- name: "👕 Lint"
run: yarn lint
build:
name: "Build"
needs: install
runs-on: ubuntu-latest
steps:
- name: "🛎 Checkout"
uses: actions/checkout@v3
- name: "🔧 Setup"
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'yarn'
- name: "💾 Cache dependencies"
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('yarn.lock') }}
- 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: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'yarn'
- name: "💾 Cache dependencies"
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('yarn.lock') }}
- 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: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'yarn'
- name: "💾 Cache dependencies"
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('yarn.lock') }}
- name: "📥 Download build"
uses: actions/download-artifact@v3
with:
name: build
- name: "🗜️ Unzip build"
run: unzip build.zip
- name: "✅ Validate"
run: yarn validate:firefox