From f4c35cd4dadb9330196000b26acc0e521131f328 Mon Sep 17 00:00:00 2001 From: Cathal Noonan <14317886+cathalnoonan@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:42:05 +0100 Subject: [PATCH] [build]: Update PCF Tools packages to v0.3.2 (#41) * [build]: Update PCF Tools packages to v0.3.2 * Remove "DRAFT_RELEASE.yml" * Delete .github/workflows/BUILD.yml --------- Co-authored-by: [pcf-tools] --- .github/workflows/BUILD.yml | 85 ------------------- .github/workflows/build.yml | 41 +++++++++ .github/workflows/devcontainer.yml | 2 +- .../{DRAFT_RELEASE.yml => draft-release.yml} | 0 .github/workflows/editorconfig-checker.yml | 23 +++++ .github/workflows/validate-resx-files.yml | 44 ++++++++++ control/control.pcfproj | 2 +- d365-pcf-imagecontrol.proj | 2 +- solution/solution.cdsproj | 2 +- 9 files changed, 112 insertions(+), 89 deletions(-) delete mode 100755 .github/workflows/BUILD.yml create mode 100755 .github/workflows/build.yml rename .github/workflows/{DRAFT_RELEASE.yml => draft-release.yml} (100%) create mode 100755 .github/workflows/editorconfig-checker.yml create mode 100755 .github/workflows/validate-resx-files.yml diff --git a/.github/workflows/BUILD.yml b/.github/workflows/BUILD.yml deleted file mode 100755 index 1bf791c..0000000 --- a/.github/workflows/BUILD.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: Build - -on: - workflow_dispatch: - push: - pull_request: - -env: - DOTNET_ROLL_FORWARD: Major - DOTNET_NOLOGO: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 - -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - name: "Setup: Checkout" - uses: actions/checkout@v4 - - name: "Setup: Node" - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - cache: 'npm' - cache-dependency-path: control/package-lock.json - - name: "Setup: dotnet" - uses: actions/setup-dotnet@v4 - - name: "Build: dotnet restore" - run: dotnet restore - - name: "Build: dotnet build" - run: dotnet build --no-restore - - name: "Build: dotnet test" - run: dotnet test --no-build - - name: "Artifacts: Create file containing URL of repo" - run: echo "${{ github.server_url }}/${{ github.repository }}" > ./dist/repo-url.txt - - name: "Artifacts: Upload artifact" - uses: actions/upload-artifact@v4 - with: - name: ${{ github.event.repository.name }}__extract_this_zip - path: ./dist/* - retention-days: 15 - - validate-resx-files: - name: Validate resx files - runs-on: ubuntu-latest - steps: - - name: "Setup: Checkout" - uses: actions/checkout@v4 - - name: "Setup: xmllint" - run: | - if ! command -v xmllint &> /dev/null - then - sudo apt-get update - sudo apt-get install -y libxml2-utils - fi - shell: bash - - name: "Validate: Check resx files contain valid xml" - run: | - shopt -s globstar - for resx_file in $(/bin/ls ./**/*.resx) - do - if xmllint --noout "$resx_file" > /dev/null 2>&1 ; - then - echo "Valid: $resx_file" - else - echo "Invalid: $resx_file" && exit 1 - fi - done - shell: bash - - validate-editor-config: - name: Validate editor config - runs-on: ubuntu-latest - steps: - - name: "Setup: Checkout" - uses: actions/checkout@v4 - - name: "Setup: Node" - uses: actions/setup-node@v4 - with: - node-version-file: '.nvmrc' - - name: "Setup: editorconfig-checker" - run: npm i -g editorconfig-checker - - name: "Validate: Run editorconfig-checker" - run: editorconfig-checker diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100755 index 0000000..c27a3d4 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,41 @@ +name: Build + +on: + push: + pull_request: + +env: + DOTNET_ROLL_FORWARD: Major + DOTNET_NOLOGO: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: "Setup: Checkout" + uses: actions/checkout@v4 + - name: "Setup: Node" + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'npm' + cache-dependency-path: control/package-lock.json + - name: "Setup: dotnet" + uses: actions/setup-dotnet@v4 + - name: "Build: dotnet restore" + run: dotnet restore + - name: "Build: dotnet build" + run: dotnet build --no-restore + - name: "Build: dotnet test" + run: dotnet test --no-build + - name: "Artifacts: Create file containing URL of repo" + run: echo "${{ github.server_url }}/${{ github.repository }}" > ./dist/repo-url.txt + - name: "Artifacts: Upload artifact" + uses: actions/upload-artifact@v4 + with: + name: ${{ github.event.repository.name }}__extract_this_zip + path: ./dist/* + retention-days: 15 diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index 6086e62..36237ec 100755 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -7,7 +7,7 @@ on: paths: - ".devcontainer/**" - ".github/workflows/devcontainer.yml" - - "compose.yml" + pull_request: jobs: devcontainer: diff --git a/.github/workflows/DRAFT_RELEASE.yml b/.github/workflows/draft-release.yml similarity index 100% rename from .github/workflows/DRAFT_RELEASE.yml rename to .github/workflows/draft-release.yml diff --git a/.github/workflows/editorconfig-checker.yml b/.github/workflows/editorconfig-checker.yml new file mode 100755 index 0000000..a4af6c7 --- /dev/null +++ b/.github/workflows/editorconfig-checker.yml @@ -0,0 +1,23 @@ +name: EditorConfig Checker + +on: + push: + branches: + - "**" + pull_request: + +jobs: + validate-editor-config: + name: Validate editor config + runs-on: ubuntu-latest + steps: + - name: "Setup: Checkout" + uses: actions/checkout@v4 + - name: "Setup: Node" + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + - name: "Setup: editorconfig-checker" + run: npm i -g editorconfig-checker + - name: "Validate: Run editorconfig-checker" + run: editorconfig-checker diff --git a/.github/workflows/validate-resx-files.yml b/.github/workflows/validate-resx-files.yml new file mode 100755 index 0000000..c72e839 --- /dev/null +++ b/.github/workflows/validate-resx-files.yml @@ -0,0 +1,44 @@ +name: Validate RESX Files + +on: + push: + branches: + - "**" + paths: + - ".github/workflows/validate-resx-files.yml" + - "**/*.resx" + pull_request: + +jobs: + validate-resx-files: + name: Validate resx files + runs-on: ubuntu-latest + steps: + - name: "Setup: Checkout" + uses: actions/checkout@v4 + - name: "Setup: xmllint" + run: | + if ! command -v xmllint &> /dev/null + then + sudo apt-get update + sudo apt-get install -y libxml2-utils + fi + shell: bash + - name: "Validate: Check resx files contain valid xml" + run: | + shopt -s globstar + error=0 + for resx_file in $(/bin/ls ./**/*.resx) + do + if xmllint --noout "$resx_file" > /dev/null 2>&1 ; + then + echo "Valid: $resx_file" + else + echo "Invalid: $resx_file" && error=1 + fi + done + if [[ "${error}" == "1" ]] + then + exit 1 + fi + shell: bash diff --git a/control/control.pcfproj b/control/control.pcfproj index 0e98711..016d87e 100644 --- a/control/control.pcfproj +++ b/control/control.pcfproj @@ -1,6 +1,6 @@  - + $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\PowerApps diff --git a/d365-pcf-imagecontrol.proj b/d365-pcf-imagecontrol.proj index 3c17f03..e43951e 100644 --- a/d365-pcf-imagecontrol.proj +++ b/d365-pcf-imagecontrol.proj @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/solution/solution.cdsproj b/solution/solution.cdsproj index 0b9c170..c606f7b 100644 --- a/solution/solution.cdsproj +++ b/solution/solution.cdsproj @@ -1,6 +1,6 @@  - + $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\PowerApps