From 7eca31b5f9a057a32ab905bc7019fb4431f51d7d Mon Sep 17 00:00:00 2001 From: nobkd <44443899+nobkd@users.noreply.github.com> Date: Wed, 19 Jul 2023 16:23:49 +0200 Subject: [PATCH] chore(actions): update scripts --- .github/workflows/ci.yml | 42 +++++++++++++++++---- .github/workflows/publish.yml | 70 ++++++++++++++++++++++++++++++++--- 2 files changed, 100 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da328a8..a801692 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,8 @@ concurrency: cancel-in-progress: true jobs: - ci: - name: CI + lint: + name: Lint timeout-minutes: 10 runs-on: self-hosted @@ -24,12 +24,40 @@ jobs: with: node-version: 18 - - name: Install Deps - run: npm ci --ignore-scripts --no-audit --progress=false + - name: Install + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - run: npm ci --ignore-scripts - - name: Check Formatting + - name: Lint run: npm run format - - name: Test Coverage - if: (${{ success() }} || ${{ failure() }}) + test: + name: Test + needs: [lint] + timeout-minutes: 10 + runs-on: self-hosted + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - run: npm ci --ignore-scripts + + - name: Test run: npm run test:cov diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c819ef0..9b2333f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,12 +1,66 @@ -name: Publish Release +name: Publish on: release: types: [published] +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + jobs: + lint: + name: Lint + timeout-minutes: 10 + runs-on: self-hosted + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - run: npm ci --ignore-scripts + + - name: Lint + run: npm run format + + test: + name: Test + needs: [lint] + timeout-minutes: 10 + runs-on: self-hosted + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - run: npm ci --ignore-scripts + + - name: Test + run: npm run test:cov + publish: name: Publish to Firefox AMO + needs: [lint, test] timeout-minutes: 10 runs-on: self-hosted @@ -16,8 +70,15 @@ jobs: with: node-version: 18 - - name: Install Deps - run: npm ci --ignore-scripts --no-audit --progress=false + - name: Install + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - run: npm ci --ignore-scripts - name: Build run: npm run build @@ -25,5 +86,4 @@ jobs: - name: Bundle run: npm run bundle - #- name: Sign - # run: + # Send non-minified code to AMO, Sign file with AMO, Upload artifacts to release