Skip to content

fix: improve packages compatibility + better testing #20

fix: improve packages compatibility + better testing

fix: improve packages compatibility + better testing #20

Workflow file for this run

name: Test publish
on:
pull_request:
jobs:
test-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: '${{ secrets.TOLGEE_MACHINE_PAT }}'
- name: Build
uses: actions/setup-node@v3
with:
node-version: '18'
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7.16.0
run_install: false
- name: Install
run: pnpm install --no-frozen-lockfile --filter='./packages/*'
- 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: Update version locally
run: |
lerna version prerelease --yes --conventional-prerelease --preid test.$(git rev-parse --short HEAD) \
--force-publish --no-push --no-git-tag-version --exact
# Set TOLGEE_UI_VERSION for @tolgee/core build
- name: Set env
run: |
echo "TOLGEE_UI_VERSION=$(pnpm run --silent ui-version)" >> $GITHUB_ENV
pnpm run --silent ui-version
- name: Build all packages
run: pnpm build-packages
- run: |
echo "" >> .npmrc
echo "@tolgee:registry=https://npm.pkg.github.com" >> .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
- name: Recreate release with push
run: pnpm publish -r --no-git-checks
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- id: set-dirs
run: echo "dirs=$(ls | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
working-directory: e2e/cypress/e2e
outputs:
dirs: ${{ steps.set-dirs.outputs.dirs }}
cypress:
name: 'Cypress'
needs: test-publish
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
app: ${{ fromJson(needs.test-publish.outputs.dirs) }}
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '18'
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7.16.0
run_install: false
- name: Install
run: pnpm install --no-frozen-lockfile
- 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"
- run: |
echo "" >> .npmrc
echo "link-workspace-packages=false" >> .npmrc
echo "@tolgee:registry=https://npm.pkg.github.com" >> .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
- name: Update version locally
run: |
lerna version prerelease --yes --conventional-prerelease --preid test.$(git rev-parse --short HEAD) \
--force-publish --no-push --no-git-tag-version --exact
- name: Cypress
run: pnpm run e2e run --headed ${{matrix.app}} --stdout prod,dev
- uses: actions/upload-artifact@v2
if: failure()
with:
name: cypress
path: |
e2e/cypress/videos/**/*
e2e/cypress/screenshots/**/*