Updated to NX 20.5.0 and Angular to 19.2.1 #78
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: on-pull-request-or-push | |
on: | |
pull_request: | |
branches: | |
- master | |
env: | |
FIREBASE_CHANNEL: ${{ fromJSON('["", "live"]')[!github.base_ref] }} | |
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }} | |
SAUCE_USERNAME_PR: valorkinpr | |
SAUCE_ACCESS_KEY_PR: e0a97bd3-4b74-4408-89bf-cce1b44a8bf1 | |
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/[email protected] | |
with: | |
access_token: ${{ secrets.GITHUB_TOKEN }} | |
# install dependencies | |
install: | |
runs-on: ubuntu-latest | |
needs: one_run | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
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-dragula | |
build: | |
needs: install | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ env.CACHE_NODE_MODULES_PATH }} | |
key: node_modules-${{ hashFiles('**/package-lock.json') }} | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ env.CACHE_DIST_PATH }} | |
key: dist-${{ github.run_id }} | |
- run: | | |
npx nx build demo --configuration production | |
# run unit tests | |
unit_tests_with_coverage: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ env.CACHE_NODE_MODULES_PATH }} | |
key: node_modules-${{ hashFiles('**/package-lock.json') }} | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ env.CACHE_DIST_PATH }} | |
key: dist-${{ github.run_id }} | |
- run: npx nx run-many --target=test --all --code-coverage | |
continue-on-error: true | |
# run linting | |
linting: | |
runs-on: ubuntu-latest | |
needs: install | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ env.CACHE_NODE_MODULES_PATH }} | |
key: node_modules-${{ hashFiles('**/package-lock.json') }} | |
- run: npm run lint | |
# firebase deploy preview | |
firebase_preview: | |
runs-on: ubuntu-latest | |
needs: build | |
outputs: | |
output_url: ${{ steps.firebase_hosting_preview.outputs.details_url }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
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_NG2_DRAGULA }}' | |
projectId: ng2-dragula | |
channelId: ${{ env.FIREBASE_CHANNEL }} | |
expires: 3d |