* feat(chore): updated version up to angular 13 and nx 13 * version fixies * chore(bump): updated version up to angular, nx 14 * check key * fix(ci): fixed yml files * fix(ci): fix build commands * fix(ci): fix build commands * fix(ci): fix build commands * fix(ci): fix build commands * fix(chore): fixed peerdependencies * fix(test): deleted ts-ignore from .spec files * fix(test): little cleaning * fix(chore): deleted unnecessery command
114 lines
3.0 KiB
YAML
114 lines
3.0 KiB
YAML
name: on-pull-request-or-push
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- development
|
|
|
|
env:
|
|
NX_BRANCH: ${{ github.event.number }}
|
|
NX_RUN_GROUP: ${{ github.run_id }}
|
|
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
|
|
MOZ_HEALESS: 1
|
|
SAUCE_USERNAME_PR: valorkinpr
|
|
FIREBASE_CHANNEL: ${{ fromJSON('["", "live"]')[!github.base_ref] }}
|
|
|
|
CACHE_NODE_MODULES_PATH: |
|
|
~/.npm
|
|
node_modules
|
|
|
|
CACHE_DIST_PATH: |
|
|
dist
|
|
|
|
jobs:
|
|
# one run
|
|
one_run:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Cancel Previous Runs
|
|
uses: styfle/cancel-workflow-action@0.9.0
|
|
with:
|
|
access_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# install dependencies
|
|
install:
|
|
runs-on: ubuntu-latest
|
|
needs: one_run
|
|
steps:
|
|
- uses: actions/checkout@v2.3.4
|
|
- uses: actions/cache@v2.1.4
|
|
id: cache
|
|
with:
|
|
path: ${{ env.CACHE_NODE_MODULES_PATH }}
|
|
key: node_modules-${{ hashFiles('**/package-lock.json') }}
|
|
- run: npm ci
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
# build ng2-file-upload
|
|
build:
|
|
needs: install
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2.3.4
|
|
- uses: actions/cache@v2.1.4
|
|
with:
|
|
path: ${{ env.CACHE_NODE_MODULES_PATH }}
|
|
key: node_modules-${{ hashFiles('**/package-lock.json') }}
|
|
- uses: actions/cache@v2.1.4
|
|
with:
|
|
path: ${{ env.CACHE_DIST_PATH }}
|
|
key: dist-${{ github.run_id }}
|
|
- run: npx nx run ng2-file-upload-demo:build
|
|
|
|
# run unit tests
|
|
unit_tests_with_coverage:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: ${{ env.CACHE_NODE_MODULES_PATH }}
|
|
key: node_modules-${{ hashFiles('**/package-lock.json') }}
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: ${{ env.CACHE_DIST_PATH }}
|
|
key: dist-${{ github.run_id }}
|
|
- run: npm run test-coverage
|
|
continue-on-error: true
|
|
|
|
# run linting
|
|
linting:
|
|
runs-on: ubuntu-latest
|
|
needs: install
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: ${{ env.CACHE_NODE_MODULES_PATH }}
|
|
key: node_modules-${{ hashFiles('**/package-lock.json') }}
|
|
- run: npm run lint
|
|
|
|
# firebase preview
|
|
build_and_preview:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
outputs:
|
|
output_url: ${{ steps.firebase_hosting_preview.outputs.details_url }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: ${{ env.CACHE_DIST_PATH }}
|
|
key: dist-${{ github.run_id }}
|
|
- uses: FirebaseExtended/action-hosting-deploy@v0
|
|
continue-on-error: true
|
|
id: firebase_hosting_preview
|
|
with:
|
|
repoToken: '${{ secrets.GITHUB_TOKEN }}'
|
|
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_NGX_FILE_UPLOAD }}'
|
|
projectId: ngx-file-upload
|
|
channelId: ${{ env.FIREBASE_CHANNEL }}
|
|
expires: 7d
|