publish_and_install.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. name: Publish & Install
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - major
  7. - minor
  8. - parallel-e2e
  9. pull_request:
  10. branches:
  11. - master
  12. - major
  13. - minor
  14. defaults:
  15. run:
  16. shell: bash
  17. jobs:
  18. publish_install:
  19. runs-on: ${{ matrix.os }}
  20. strategy:
  21. matrix:
  22. os: [ubuntu-latest, windows-latest, macos-latest]
  23. # Temporarily disabled Node v18 because of this issue:
  24. # https://github.com/vendure-ecommerce/vendure/actions/runs/5200017548/jobs/9378196658#step:4:48
  25. # which is related to our Verdaccio setup. Will need some investigation.
  26. #node-version: [16.x, 18.x]
  27. node-version: [16.x]
  28. fail-fast: false
  29. steps:
  30. - uses: actions/checkout@v3
  31. - name: Use Node.js ${{ matrix.node-version }}
  32. uses: actions/setup-node@v3
  33. with:
  34. node-version: ${{ matrix.node-version }}
  35. - name: Install Verdaccio
  36. run: |
  37. npm install -g verdaccio
  38. npm install -g verdaccio-auth-memory
  39. npm install -g verdaccio-memory
  40. npm install -g npm-auth-to-token@1.0.0
  41. tmp_registry_log=`mktemp`
  42. mkdir -p $HOME/.config/verdaccio
  43. cp -v ./.github/workflows/verdaccio/config.yaml $HOME/.config/verdaccio/config.yaml
  44. nohup verdaccio --config $HOME/.config/verdaccio/config.yaml &>$tmp_registry_log &
  45. npm-auth-to-token -u test -p test -e test@test.com -r http://0.0.0.0:4873
  46. - name: Windows dependencies
  47. if: matrix.os == 'windows-latest'
  48. run: npm install -g @angular/cli
  49. # - name: Get yarn cache directory path
  50. # id: yarn-cache-dir-path
  51. # run: echo "::set-output name=dir::$(yarn cache dir)"
  52. # - uses: actions/cache@v3
  53. # id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  54. # with:
  55. # path: '**/node_modules'
  56. # key: ${{ runner.os }}-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
  57. # restore-keys: |
  58. # ${{ runner.os }}-${{ matrix.node-version }}-yarn-
  59. - name: Yarn install
  60. # if: steps.yarn-cache.outputs.cache-hit != 'true'
  61. run: |
  62. yarn config set unsafe-perm true
  63. yarn install --network-timeout 1000000 --prefer-offline
  64. env:
  65. CI: true
  66. - name: Bootstrap
  67. run: yarn bootstrap
  68. env:
  69. CI: true
  70. - name: Publish to Verdaccio
  71. run: |
  72. yarn lerna publish prepatch --preid ci --no-push --no-git-tag-version --no-commit-hooks --force-publish "*" --yes --dist-tag ci --registry http://0.0.0.0:4873
  73. - name: Install via @vendure/create
  74. run: |
  75. mkdir -p $HOME/install
  76. cd $HOME/install
  77. npm set registry=http://0.0.0.0:4873
  78. npm dist-tag ls @vendure/create
  79. npx @vendure/create@ci test-app --ci --use-npm --log-level info
  80. - name: Server smoke tests
  81. run: |
  82. cd $HOME/install/test-app
  83. npm run dev &
  84. node $GITHUB_WORKSPACE/.github/workflows/scripts/smoke-tests