Skip to content

fix: improve packages compatibility + better testing #29

fix: improve packages compatibility + better testing

fix: improve packages compatibility + better testing #29

Workflow file for this run

name: Test publish
on:
pull_request:
jobs:
prepare:
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: 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
run: |
pnpm install --ignore-workspace
pnpm install --no-frozen-lockfile --filter='./packages/*'
- name: Update version locally
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
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 "//npm.pkg.github.com/:_authToken=${{ secrets.TOLGEE_MACHINE_PAT }}" >> .npmrc
echo "@tolgee:registry=https://npm.pkg.github.com" >> .npmrc
- name: Publish to GitHub Packages
run: pnpm publish -r --no-git-checks --tag test
env:
NODE_AUTH_TOKEN: ${{secrets.TOLGEE_MACHINE_PAT}}
- 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:
needs: prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
app: ${{ fromJson(needs.prepare.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 --ignore-workspace
- 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 "//npm.pkg.github.com/:_authToken=${{ secrets.TOLGEE_MACHINE_PAT }}" >> .npmrc
echo "@tolgee:registry=https://npm.pkg.github.com" >> .npmrc
- name: Update version locally
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
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/**/*