Implements Hamilton UI -- OS from previously closed source #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'ui/**' | |
pull_request: | |
types: [opened, synchronize, reopened] | |
paths: | |
- 'ui/**' | |
jobs: | |
check-changes: | |
runs-on: ubuntu-latest | |
outputs: | |
changes: ${{ steps.filter.outputs.changes }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 # fetch previous commit for comparison | |
- id: filter | |
run: | | |
echo "Checking for changes in the frontend directory and branch..." | |
# Check if the current branch is not main | |
if [[ "${{ github.ref }}" != "refs/heads/main" ]]; then | |
# Check for changes in the frontend directory | |
if git diff --quiet HEAD^ HEAD -- ui/frontend/; then | |
echo "::set-output name=skip::true" | |
echo "No changes in backend/ or not on main branch, skipping subsequent jobs." | |
else | |
echo "::set-output name=skip::false" | |
echo "Changes detected in frontend/ and not on main branch." | |
fi | |
else | |
echo "::set-output name=skip::false" | |
echo "On main branch, proceeding with subsequent jobs." | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: telemetry/ui | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: npm install --ignore-scripts | |
- run: npm run build | |
- run: npm run lint:fix | |
- run: npm run format:fix |