Skip to content

fix: Multiple naming errors #1726

fix: Multiple naming errors

fix: Multiple naming errors #1726

Workflow file for this run

name: Pull request validation
on: pull_request
env:
NX_PARALLEL: 4 # ubuntu-latest = 4-core CPU / 16 GB of RAM | macos-14-xlarge (arm) = 6-core CPU / 14 GB of RAM
NX_VERBOSE_LOGGING: true
jobs:
valid-asset-names:
name: Validate Asset Names
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check asset directories are valid for Windows
run: |
ls assets | python3 -c """
import sys
assets_dir = sys.stdin.read().strip().split('\n')
invalid_asset_dirs = []
for dir in assets_dir:
if dir.endswith(' '):
invalid_asset_dirs.append(dir)
if invalid_asset_dirs:
print('Invalid asset directories, remove the trailing space')
print(invalid_asset_dirs)
exit(1)
"""
valid-asset-fills:
name: Validate Asset Fills
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check that all SVGs have the right fill
run: |
error_found=false
for file in $(find ./assets -type f -name "*.svg" -print0 | grep -zv '_color.svg' | xargs -0 grep -L 'fill="#212121"'); do
echo "Error: $file does not have 'fill=\"#212121\"' or has a different fill."
error_found=true
done
if [[ $error_found == true ]]; then
exit 1
fi
build-ios:
name: Build iOS library
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm ci
- name: Run generate script
run: npm run deploy:ios
working-directory: importer
build-android:
name: Build Android library
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm ci
- name: Run generate script
run: npm run deploy:android
working-directory: importer
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 11
# https://github.com/marketplace/actions/gradle-command
- name: Build Android library
uses: eskatos/gradle-command-action@v1
with:
arguments: assembleRelease
build-root-directory: android
wrapper-directory: android
- name: Generate BUILD.gn file for Android
run: python3 generate_build_gn_android.py
working-directory: importer
# Disabling for now until the pipeline job is fixed
# build-flutter:
# name: Build Flutter library
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v1
# with:
# node-version: 20.x
# - run: npm ci
# - name: Run generate script
# run: npm run deploy:flutter
# working-directory: importer
# # Build Flutter library
# # The name should be same as the package name on pub.dev
# # Tokens are placeholder strings in order for the action to run on forked repos.
# - name: 'fluentui_system_icons'
# uses: k-paxian/dart-package-publisher@master
# with:
# relativePath: 'flutter'
# skipTests: true
# dryRunOnly: true
# accessToken: "placeholder"
# refreshToken: "placeholder"
build-svg:
if: ${{ github.repository_owner == 'microsoft' }}
name: Build svg library
runs-on: ubuntu-latest
permissions:
contents: 'read'
actions: 'read'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm ci
# Use once allowed
# - uses: nrwl/nx-set-shas@826660b82addbef3abff5fa871492ebad618c9e1 # v4.3.3
- name: Set NX_BASE and NX_HEAD
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "NX_BASE=${{ github.event.pull_request.base.sha }}" >> $GITHUB_ENV
echo "NX_HEAD=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "NX_BASE=${{ github.event.before }}" >> $GITHUB_ENV
echo "NX_HEAD=${{ github.sha }}" >> $GITHUB_ENV
fi
echo "Base SHA: $NX_BASE"
echo "Head SHA: $NX_HEAD"
- name: Check if svg packages are affected
id: check-affected
run: |
AFFECTED=$(npx nx show projects --affected --base=$NX_BASE --head=$NX_HEAD --json | jq -r '.[]' | grep -E 'svg-icons|svg-sprites' || echo "")
if [ -n "$AFFECTED" ]; then
echo "affected=true" >> $GITHUB_OUTPUT
echo "SVG packages are affected: $AFFECTED"
else
echo "affected=false" >> $GITHUB_OUTPUT
echo "svg-icons and svg-sprites are not affected, skipping build"
fi
- name: Build svg packages
if: steps.check-affected.outputs.affected == 'true'
run: |
AFFECTED=$(npx nx show projects --affected --base=$NX_BASE --head=$NX_HEAD --json | jq -r '.[]')
if echo "$AFFECTED" | grep -q 'svg-icons'; then
echo "Building svg-icons..."
npx nx run svg-icons:build
fi
if echo "$AFFECTED" | grep -q 'svg-sprites'; then
echo "Building svg-sprites..."
npx nx run svg-sprites:build
fi
build-react:
if: ${{ github.repository_owner == 'microsoft' }}
name: Build react library
runs-on: ubuntu-latest
permissions:
contents: 'read'
actions: 'read'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm ci
# Use once allowed
# - uses: nrwl/nx-set-shas@826660b82addbef3abff5fa871492ebad618c9e1 # v4.3.3
- name: Set NX_BASE and NX_HEAD
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "NX_BASE=${{ github.event.pull_request.base.sha }}" >> $GITHUB_ENV
echo "NX_HEAD=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "NX_BASE=${{ github.event.before }}" >> $GITHUB_ENV
echo "NX_HEAD=${{ github.sha }}" >> $GITHUB_ENV
fi
echo "Base SHA: $NX_BASE"
echo "Head SHA: $NX_HEAD"
- name: Lint
run: npx nx affected -t lint --exclude='svg-icons,svg-sprites'
- name: Build
# svg-icons:build is run in different job (@see build-svg), -> exclude
# svg-sprites:build doesn't work and is missing owner, -> exclude
run: |
npx nx affected -t build --exclude='svg-icons,svg-sprites'
npx nx affected -t build-verify --exclude='svg-icons,svg-sprites'
- name: Test
run: npx nx affected -t test --exclude='svg-icons,svg-sprites'
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: icon-app-build
path: packages/icon-app/dist/
retention-days: 7