Skip to content

fix(*): tests setup config #67186

fix(*): tests setup config

fix(*): tests setup config #67186

Workflow file for this run

name: Run tests
on:
push:
branches-ignore: [master]
jobs:
test:
runs-on: ubuntu-latest
steps:
# choose with pkgs and storage you want to clean
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/[email protected]
with:
tool-cache: true
android: false
dotnet: false
haskell: false
large-packages: false
docker-images: false
swap-storage: true
- name: Checkout latest code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 22.x
uses: actions/setup-node@v3
with:
node-version: 22
# Restore and cache node_modules and yarn.lock related cache
- name: Restore node_modules cache
uses: actions/cache@v3
with:
path: |
~/.cache/yarn
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install repository
run: yarn install --frozen-lockfile
- name: Build covered packages and dependencies
run: |
yarn build --filter="./packages/manager/core/*" --concurrency=5
yarn build --filter="./packages/manager-ui-kit"
yarn build --filter="./packages/manager/modules/order"
yarn build --filter="./packages/manager/modules/common-api"
yarn build --filter="./packages/manager/modules/common-translations"
yarn build --filter="./packages/manager/modules/vcd-api"
yarn build --filter="./packages/manager/modules/manager-pci-common"
yarn build --filter="./packages/manager/modules/network-common"
yarn build --filter="./packages/components/ovh-payment-method"
- name: Run tests on changed packages
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
run: |
BRANCH=$(git branch --show-current)
echo "My branch is $BRANCH"
if [[ "$BRANCH" == "master" ]]; then
echo "My branch is master and no unit test to run, exit..."
exit 0
fi
BASE_BRANCH=$(gh pr view --json baseRefName -q ".baseRefName")
if [[ -z "$BASE_BRANCH" ]]; then
export BASE_BRANCH="master"
export CURRENT_BRANCH=${BRANCH}
echo "NO PR FOUND for branch $BRANCH from ${BASE_BRANCH}"
else
echo "Base Branch is $BASE_BRANCH"
echo "current Branch is ${BRANCH}"
export BASE_BRANCH="${BASE_BRANCH//\"/}"
export CURRENT_BRANCH="${BRANCH//\"/}"
echo "BASE_BRANCH=$BASE_BRANCH" >> $GITHUB_ENV
echo "CURRENT_BRANCH=$CURRENT_BRANCH" >> $GITHUB_ENV
fi
yarn test --concurrency=1 --filter=...[origin/${BASE_BRANCH}...origin/${BRANCH}]