Skip to content

Configure Renovate - autoclosed #251

Configure Renovate - autoclosed

Configure Renovate - autoclosed #251

name: CI
on:
push:
branches-ignore:
- "_archived__**"
pull_request_target:
branches-ignore:
- "_archived__**"
paths-ignore:
- "**/README.md"
jobs:
pre_info:
name: Initial Checks
runs-on: ubuntu-latest
outputs:
skipCI: ${{ steps.checkci.outputs.result }}
gitSHA: ${{ steps.checkci.outputs.gitSHA }}
steps:
- name: Run CI Check
id: checkci
env:
GH_API: ${{ github.event.repository.commits_url }}
GH_GH: ${{ toJson(github) }}
GH_SHA: ${{ github.event.after }}
PR_FIRSTSHA: ${{ github.event.pull_request.head.sha }}
PR_NUM: ${{ github.event.pull_request.number }}
run: |
echo "Run ID : $GITHUB_RUN_ID"
echo "Event Name: $GITHUB_EVENT_NAME"
echo "PR_NUM : $PR_NUM"
EXP_REF="ds\/(.*)$"
if [[ $GITHUB_REF =~ $EXP_REF ]]; then
GH_REF=${BASH_REMATCH[1]}
fi
REF=$([[ $GITHUB_HEAD_REF ]] && echo $GITHUB_HEAD_REF || echo $GH_REF)
echo "HEAD_REF : $GITHUB_HEAD_REF"
echo "GITHUB_REF: $GITHUB_REF"
echo "GH_REF : $GH_REF"
echo "Branch : $REF"
GH_SHA=$([[ $GH_SHA ]] && echo $GH_SHA || echo $PR_FIRSTSHA)
echo "::set-output name=gitSHA::$GH_SHA"
echo "Commit SHA: $GH_SHA"
echo "PR Head SHA: $PR_FIRSTSHA"
SKIP_A=$([[ "$REF" == l10n_* ]] && echo true || echo false)
echo "Starts With l10n_ : $SKIP_A"
GH_API=${GH_API/'{/sha}'/}
echo "API: $GH_API"
CM=$(curl -s $GH_API/$GH_SHA | jq -r '.commit.message')
echo "Commit Message: $CM"
EXP_SKIP="\[ci skip]"
SKIP_B=$([[ "$CM" =~ $EXP_SKIP ]] && echo true || echo false)
echo "Skip via Commit: $SKIP_B"
RES=$([[ $SKIP_A == true || $SKIP_B == true ]] && echo true || echo false)
echo "Skip CI: $RES"
echo "::set-output name=result::$RES"
all_jobs:
name: Tests, Builds, Coverage
runs-on: ubuntu-latest
needs: pre_info
if: needs.pre_info.outputs.skipCI == 'false'
steps:
- name: Checkout Commit
uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v2.1.4
with:
node-version: "14.x"
- name: Get Node Version
id: node
run: |
echo "Node Version: $(node -v)"
echo "::set-output name=version::$(node -v)"
- name: Cache Node Modules
id: nodeCache
uses: actions/cache@v2
with:
# npm cache files stored in `~/.npm` on Linux
path: ~/.npm
key: ${{ runner.os }}-nodejs-${{ steps.node.outputs.version }}-npm-${{ hashFiles('**/package.json', '**/package-lock.json') }}
- name: Install dependencies from cache (npm --cache-min install)
if: steps.nodeCache.outputs.cache-hit == 'true'
run: npm --cache-min 9999999 install
- name: Install dependencies (npm ci)
if: steps.nodeCache.outputs.cache-hit != 'true'
run: npm ci
- name: Run Tests
run: npm run test -- --verbose
- name: Run Lint
run: npm run lint
- name: Run Build
run: npm run build
env:
GITSHA: ${{ needs.pre_info.outputs.gitSHA }}
- name: Archive Code Coverage Results
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage
- name: Codecov.io Coverage upload
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: false
file: ./coverage/*
token: ${{ secrets.CODECOV_TOKEN }} # Optional as it is open source repo
- name: Codecov.io Alternative Coverage Upload
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
env:
PR_NUM: ${{ github.event.pull_request.number }}
CC_TOKEN: ${{ secrets.CODECOV_TOKEN }} # Optional as it is open source repo
run: bash ./.github/codecov_alt.sh $GITHUB_EVENT_PATH
- name: Coveralls.io Coverage Upload
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Extract zip builds for individual artifact upload
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
id: extbuilds
run: |
for i in *.zip; do echo "${i%.zip}"; done | xargs -I fn unzip fn.zip -d fn
echo "::set-output name=ffdir::$(ls -d *Firefox)"
echo "::set-output name=crdir::$(ls -d *Chrome)"
working-directory: ./builds
- name: Upload Artifact for Mozilla Firefox Build
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: actions/upload-artifact@v2
with:
name: ${{ steps.extbuilds.outputs.ffdir }}
path: builds/${{ steps.extbuilds.outputs.ffdir }}
- name: Upload Artifact for Google Chrome Build
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: actions/upload-artifact@v2
with:
name: ${{ steps.extbuilds.outputs.crdir }}
path: builds/${{ steps.extbuilds.outputs.crdir }}
- name: Hide old PR Build Comments
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: kanga333/comment-hider@v0.1.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create PR Build Comment
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: peter-evans/create-or-update-comment@v1.4.4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
## Pull Request Build: ${{ github.run_id }}
- based on latest commit: ${{ needs.pre_info.outputs.gitSHA }}
Unsigned webextension builds for testing is ready for download!
These test builds are only kept for *up to 90 days* from the date of this post.
It is strongly recommended to use a fresh profile for testing these builds to prevent any kind of modifications to existing data.
### Generating Download Links
- `/get-build` for the latest commit build.
- `/get-build ${{ github.run_id }}` for this specific commit ${{ github.event.after }} build.
---
*When new command comment is posted, please allow a few seconds for the command to be received and processed.*
- :eyes: indicates that command has been received.
- :rocket: indicates that command has been sent for further processing.
- :tada: indicates that command has been executed. Expect a new comment with the result shortly.
*Due to API limitations, generated links will only be valid for one minute!*
reactions: heart