Skip to content

Commit

Permalink
fix: PR workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Orel <oorel@redhat.com>
  • Loading branch information
olexii4 committed Sep 18, 2024
1 parent e1fe428 commit ec77bda
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 5 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,28 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 18
-
name: "Install dependencies"
run: yarn install
-
name: "Check dependencies usage restrictions"
run: yarn license:check

dash-licenses-yarn-v1:
runs-on: ubuntu-22.04
if: ${{ github.base_ref == 'main' }}
steps:
-
name: "Checkout Che Dashboard source code"
uses: actions/checkout@v4
-
name: "Use Node 20"
uses: actions/setup-node@v4
with:
node-version: 20
-
name: "Switch to Yarn 1"
run: npm run changePackageMenedgerVersion
-
name: "Install dependencies"
run: yarn
Expand Down Expand Up @@ -88,6 +110,42 @@ jobs:
name: "Run unit tests"
run: yarn test

build-and-test-yarn-v1:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [20.x]
steps:
-
name: "Checkout Che Dashboard source code"
uses: actions/checkout@v4
-
name: "Use Node.js ${{ matrix.node-version }}"
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
-
name: "Switch to Yarn 1"
run: npm run changePackageMenedgerVersion
-
name: "Install dependencies"
run: yarn install --force
-
name: "Build common"
run: yarn --cwd packages/common build
-
name: "Build frontend"
run: yarn --cwd packages/dashboard-frontend build
-
name: "Test frontend"
run: yarn --cwd packages/dashboard-frontend test
-
name: "Build backend"
run: yarn --cwd packages/dashboard-backend build
-
name: "Test backend"
run: yarn --cwd packages/dashboard-backend test

docker-build:
needs: build-and-test
runs-on: ubuntu-22.04
Expand Down
11 changes: 6 additions & 5 deletions scripts/yarn/change_package_manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

# The script is used to change current package manager(yarn 1 vs yarn 3)

export OLD_VERSION_DIR=$(pwd)/scripts/yarn/old_version
export TMP_DIR=$(pwd)/scripts/yarn/tmp
OLD_VERSION_DIR=$(pwd)/scripts/yarn/old_version
TMP_DIR=$(pwd)/scripts/yarn/tmp

#==========================Clean temporary directory============================
if [ -d $TMP_DIR ]; then
echo "[INFO]: Clean temporary directory"
rm -rf $(pwd)/scripts/yarn/tmp
rm -rf $TMP_DIR
else
echo "[INFO]: Create temporary directory"
fi
Expand Down Expand Up @@ -49,14 +49,15 @@ fi
#==========================Restore old version=================================
if [ -d $OLD_VERSION_DIR ]; then
echo "[INFO]: Restore old package manager version"
mv -f $OLD_VERSION_DIR/{*,.*} $(pwd)/ > /dev/null 2>&1
mv -f $OLD_VERSION_DIR/{*,.[!.]*} $(pwd)/
fi
#==========================Cleanup=============================================
if [ -d $TMP_DIR ]; then
echo "[INFO]: Cleanup"
mv -f $TMP_DIR/{*,.*} $OLD_VERSION_DIR/ > /dev/null 2>&1
mv -f $TMP_DIR/{*,.[!.]*} $OLD_VERSION_DIR/
fi

#==========================Check current version================================
VER=$(yarn --cwd $(pwd) -v | sed -e s/\\./\\n/g | sed -n 1p)

echo
Expand Down

0 comments on commit ec77bda

Please sign in to comment.