Skip to content

fix: update typescript dependencies #605

fix: update typescript dependencies

fix: update typescript dependencies #605

Workflow file for this run

name: on branch push
on:
push:
branches:
- '*' # matches every branch that doesn't contain a '/'
- '*/*' # matches every branch containing a single '/'
- '**' # matches every branch
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
# JOB to run change detection
changes:
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
outputs:
# Expose matched filters as job 'packages' output variable
libs: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@master
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
dfts-helper:
- 'libs/dfts-helper/**'
- '{package,nx,migrations,tsconfig.base}.json'
- 'pnpm-lock.yaml'
- '.github/**'
dfts-qrcode:
- 'libs/dfts-qrcode/**'
- '{package,nx,migrations,tsconfig.base}.json'
- 'pnpm-lock.yaml'
- '.github/**'
dfx-bootstrap-table:
- 'libs/dfx-bootstrap-table/**'
- '{package,nx,migrations,tsconfig.base}.json'
- 'pnpm-lock.yaml'
- '.github/**'
dfx-helper:
- 'libs/dfx-helper/**'
- '{package,nx,migrations,tsconfig.base}.json'
- 'pnpm-lock.yaml'
- '.github/**'
dfx-qrcode:
- 'libs/dfx-qrcode/**'
- '{package,nx,migrations,tsconfig.base}.json'
- 'pnpm-lock.yaml'
- '.github/**'
dfx-translate:
- 'libs/dfx-translate/**'
- '{package,nx,migrations,tsconfig.base}.json'
- 'pnpm-lock.yaml'
- '.github/**'
test:
name: Test ${{ matrix.lib }}
runs-on: ubuntu-latest
continue-on-error: true
needs: changes
if: ${{ needs.changes.outputs.libs != '[]' && needs.changes.outputs.libs != '' }}
strategy:
matrix:
lib: ${{ fromJSON(needs.changes.outputs.libs) }}
steps:
- uses: actions/checkout@master
- name: setup node and pnpm
uses: dafnik/setup-node-pnpm@v1
with:
install-ignore-scripts: true
- name: test ${{ matrix.lib }}
run: pnpm exec nx test ${{ matrix.lib }} --configuration=ci --coverageReporters=cobertura --coverageDirectory="coverage/libs/${{ matrix.lib }}"
- name: setup coverage report
uses: ./.github/actions/setup-coverage-report
with:
path: coverage/libs/${{ matrix.lib }}/cobertura-coverage.xml
build-lib:
name: Build ${{ matrix.lib }}
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.libs != '[]' && needs.changes.outputs.libs != '' }}
strategy:
matrix:
lib: ${{ fromJSON(needs.changes.outputs.libs) }}
steps:
- uses: actions/checkout@master
- name: setup node and pnpm
uses: dafnik/setup-node-pnpm@v1
with:
install-ignore-scripts: true
- name: build ${{ matrix.lib }}
run: pnpm exec nx build ${{ matrix.lib }}
- uses: actions/upload-artifact@master
name: create ${{ matrix.lib }} artifact
with:
name: ${{ matrix.lib }}
path: ./dist/libs/${{ matrix.lib }}
retention-days: 1
deploy-lib:
name: Deploy ${{ matrix.lib }} dev
needs: [ build-lib, test, changes ]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
strategy:
matrix:
lib: ${{ fromJSON(needs.changes.outputs.libs) }}
steps:
- uses: actions/checkout@master
- uses: actions/download-artifact@master
with:
name: ${{ matrix.lib }}
path: ./dist
- name: dist lookup
run: cd dist && ls -la && cd -
- name: zip ${{ matrix.lib }}.zip
run: zip -r "${{ matrix.lib }}.zip" ./dist >> /dev/null
- name: copy build to release server
uses: garygrossgarten/github-action-scp@release
with:
local: ./${{ matrix.lib }}.zip
remote: /var/www/share/releases/${{ matrix.lib }}/${{ matrix.lib }}-dev.zip
host: ${{ secrets.RELEASES_SSH_HOST }}
port: ${{ secrets.RELEASES_SSH_PORT }}
username: ${{ secrets.RELEASES_SSH_USER }}
privateKey: ${{ secrets.RELEASES_SSH_PRIVATE_KEY }}
# JOB to run change detection
app-changes:
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
outputs:
# Expose matched filters as job 'packages' output variable
apps: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@master
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
dfx-bootstrap-table-demo:
- 'apps/dfx-bootstrap-table-demo/**'
- 'libs/dfx-boostrap-table/**'
- '{package,nx,migrations,tsconfig.base}.json'
- 'pnpm-lock.yaml'
- '.github/**'
dfx-qrcode-demo:
- 'apps/dfx-qrcode-demo/**'
- 'libs/dfx-qrcode/**'
- '{package,nx,migrations,tsconfig.base}.json'
- 'pnpm-lock.yaml'
- '.github/**'
build-app:
name: Build ${{ matrix.app }}
runs-on: ubuntu-latest
needs: app-changes
if: ${{ needs.app-changes.outputs.apps != '[]' && needs.app-changes.outputs.apps != '' }}
strategy:
matrix:
app: ${{ fromJSON(needs.app-changes.outputs.apps) }}
steps:
- uses: actions/checkout@master
- name: setup node and pnpm
uses: dafnik/setup-node-pnpm@v1
with:
install-ignore-scripts: true
- name: build ${{ matrix.app }}
run: pnpm exec nx build ${{ matrix.app }}
- uses: actions/upload-artifact@master
name: create ${{ matrix.app }} artifact
with:
name: ${{ matrix.app }}
path: ./dist/apps/${{ matrix.app }}
retention-days: 1
deploy-app:
name: Deploy ${{ matrix.app }}
needs: [ app-changes, build-app ]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
strategy:
matrix:
app: ${{ fromJSON(needs.app-changes.outputs.apps) }}
steps:
- uses: actions/checkout@master
- uses: actions/download-artifact@master
with:
name: ${{ matrix.app }}
path: ./dist
- name: dist lookup
run: cd dist && ls -la && cd -
- name: zip ${{ matrix.app }}.zip
run: zip -r "${{ matrix.app }}.zip" ./dist >> /dev/null
- name: copy build files to demo server
uses: garygrossgarten/github-action-scp@release
with:
local: ./dist
remote: /var/www/${{ matrix.app }}
rmRemote: true
host: ${{ secrets.DEMO_SSH_HOST }}
port: ${{ secrets.DEMO_SSH_PORT }}
username: ${{ secrets.DEMO_SSH_USER }}
privateKey: ${{ secrets.DEMO_SSH_PRIVATE_KEY }}
- name: get library release server directory path
id: remove-demo-in-path
uses: frabert/replace-string-action@v2
with:
string: ${{ matrix.app }}
pattern: '(-demo)'
replace-with: ''
- name: copy build to release server
uses: garygrossgarten/github-action-scp@release
with:
local: ./${{ matrix.app }}.zip
remote: /var/www/share/releases/${{ steps.remove-demo-in-path.outputs.replaced }}/${{ matrix.app }}.zip
host: ${{ secrets.RELEASES_SSH_HOST }}
port: ${{ secrets.RELEASES_SSH_PORT }}
username: ${{ secrets.RELEASES_SSH_USER }}
privateKey: ${{ secrets.RELEASES_SSH_PRIVATE_KEY }}