Skip to content

Commit

Permalink
Simplify CI build and use latest release of @wvr/core
Browse files Browse the repository at this point in the history
  • Loading branch information
wwelling committed Apr 3, 2024
1 parent f1cbebd commit 2c279ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 48 deletions.
49 changes: 2 additions & 47 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,12 @@ name: Build

on: [ push, pull_request, workflow_dispatch ]

env:
CI_WUI_BRANCH: ${{ vars.CI_WUI_BRANCH }}
CI_WUI_DISABLE_LOCAL_PUBLISH: ${{ vars.CI_WUI_DISABLE_LOCAL_PUBLISH }}

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: "Checkout Repository"
uses: actions/checkout@v3
with:
path: repo

- name: "Checkout Weaver-UI-Core"
uses: actions/checkout@v3
with:
repository: TAMULib/Weaver-UI-Core
path: weaver-ui
ref: 2.x
# Specify depth of 0 to enable fetching all branches and tags so that the "Use Custom Weaver-UI-Core Repo Version" works.
fetch-depth: 0

- name: "Detect Custom Weaver-UI-Core Repo Version"
continue-on-error: true
if: ${{ env.CI_WUI_BRANCH == '' }}
run: |
cd weaver-ui
export CI_WUI_BRANCH_VERSION=$(grep -so -m 1 '"@wvr/core": "[^"]*"' ../repo/package.json | sed -e 's|"@wvr/core": "||' -e 's|"$||')
export CI_WUI_BRANCH=$(git tag | grep -so -m 1 "^$CI_WUI_BRANCH_VERSION$")
# Some projects prefix their version with a "v".
if [[ $CI_WUI_BRANCH == "" && $CI_WUI_BRANCH_VERSION != "" ]] ; then export CI_WUI_BRANCH=$(git tag | grep -so -m 1 "^v$CI_WUI_BRANCH_VERSION$") ; fi
echo "CI_WUI_BRANCH=$CI_WUI_BRANCH" >> $GITHUB_ENV
- name: "Use Custom Weaver-UI-Core Repo Version"
continue-on-error: true
if: ${{ env.CI_WUI_BRANCH != '' }}
run: |
cd weaver-ui
git reset --hard $CI_WUI_BRANCH
- name: "Run Weaver-UI-Core Docker Compose Registry Image"
run: docker-compose -f $GITHUB_WORKSPACE/weaver-ui/docker-compose.yml up -d registry

- name: "Publish Weaver-UI-Core (@wvr/core)"
if: ${{ env.CI_WUI_DISABLE_LOCAL_PUBLISH != 'true' }}
run: |
cd $GITHUB_WORKSPACE/weaver-ui
npm run publish:local
- uses: actions/checkout@v3

- name: "Install Chrome Drivers"
run: sudo apt-get install xvfb
Expand All @@ -74,12 +31,10 @@ jobs:

- name: "Install Node"
run: |
cd $GITHUB_WORKSPACE/repo
npm install --registry=http://localhost:4873
npm install
- name: "Run Node Tests"
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
cd $GITHUB_WORKSPACE/repo
xvfb-run --auto-servernum npm run test:ci
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"start": "wvr server --port 8080"
},
"dependencies": {
"@wvr/core": "2.2.2-rc.14",
"@wvr/core": "2.2.6",
"angular-ui-tinymce": "0.0.19",
"ng-csv": "0.3.6",
"ng-table": "3.0.1",
Expand Down

0 comments on commit 2c279ea

Please sign in to comment.