Skip to content

Commit

Permalink
chore: add tests using registry
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan662 committed Aug 22, 2023
1 parent 7a527e0 commit 543717f
Showing 1 changed file with 19 additions and 29 deletions.
48 changes: 19 additions & 29 deletions .github/workflows/test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ jobs:
with:
token: '${{ secrets.TOLGEE_MACHINE_PAT }}'

- name: Build
uses: actions/setup-node@v3
- uses: actions/setup-node@v3
with:
node-version: '18'

Expand All @@ -26,31 +25,26 @@ jobs:
- name: Create branch
run: git checkout -b test.$(git rev-parse --short HEAD)

- name: Set git globals
run: |
git config --local user.email "[email protected]"
git config --local user.name "Tolgee Machine"
- name: Install
- name: Install root and packages dependencies
run: |
pnpm install --ignore-workspace
pnpm install --no-frozen-lockfile --filter='./packages/*'
- name: Update version locally
- name: Update version with lerna
run: |
lerna version prerelease --yes --conventional-prerelease --preid test.$(git rev-parse --short HEAD) --ignore-scripts \
--force-publish --no-push --no-git-tag-version --exact
# Set TOLGEE_UI_VERSION for @tolgee/core build
- name: Set env
- name: Set TOLGEE_UI_VERSION
run: |
echo "TOLGEE_UI_VERSION=$(pnpm run --silent ui-version)" >> $GITHUB_ENV
pnpm run --silent ui-version
- name: Build all packages
- name: Build packages
run: pnpm build-packages

- run: |
- name: Set npm registry to GitHub Packages
run: |
echo "" >> .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.TOLGEE_MACHINE_PAT }}" >> .npmrc
echo "@tolgee:registry=https://npm.pkg.github.com" >> .npmrc
Expand Down Expand Up @@ -89,32 +83,28 @@ jobs:
version: 7.16.0
run_install: false

- name: Install
run: pnpm install --ignore-workspace

- name: Create branch
run: git checkout -b test.$(git rev-parse --short HEAD)

- name: Set git globals
- name: Set npm registry to GitHub Packages and prevent linking to local packages
run: |
git config --local user.email "[email protected]"
git config --local user.name "Tolgee Machine"
- run: |
echo "" >> .npmrc
echo "link-workspace-packages=false" >> .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.TOLGEE_MACHINE_PAT }}" >> .npmrc
echo "@tolgee:registry=https://npm.pkg.github.com" >> .npmrc
- name: Update version locally
- name: Install for root and for testapps
run: |
pnpm install --ignore-workspace
pnpm install --no-frozen-lockfile --filter='./testapps/*'
pnpm install --no-frozen-lockfile --filter='./e2e'
- name: Create branch
run: git checkout -b test.$(git rev-parse --short HEAD)

- name: Update version with lerna
run: |
lerna version prerelease --yes --conventional-prerelease --preid test.$(git rev-parse --short HEAD) --ignore-scripts \
--force-publish --no-push --no-git-tag-version --exact
- name: pnpm install
run: pnpm install --no-frozen-lockfile --filter='./testapps/*'

- name: Cypress
- name: Run e2e tests
run: pnpm run e2e run --headed ${{matrix.app}} --stdout prod,dev

- uses: actions/upload-artifact@v2
Expand Down

0 comments on commit 543717f

Please sign in to comment.