Skip to content

Commit

Permalink
ci: add format check (#349)
Browse files Browse the repository at this point in the history
* ci: add format check

References: #332

* build: fix file encoding

References: #332

* ci: fix project path

References: #332

* ci: fix format check workflow

References: #332

* ci: fix format check workflow

References: #332

* ci: fix format check workflow

References: #332

* ci: fix format check workflow

Ignore warnings.

References: #332
  • Loading branch information
al-kau committed Oct 1, 2024
1 parent 6b9f6fd commit 550a385
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 1 deletion.
70 changes: 70 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
###############################################################################
#
# Copyright 2024 Eppie(https://eppie.io)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###############################################################################

---

name: "Format check"

on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
branches:
- main
- release/**
- feature/296-upgrading-to-uno-platform-5 # temporarily
pull_request:
branches:
- main
- release/**
- feature/296-upgrading-to-uno-platform-5 # temporarily

jobs:

format-check:

strategy:
matrix:
include:
- project: "source/Eppie.App/Eppie.App/Eppie.App.csproj"
uno: "true"
- project: "source/Eppie.App/Eppie.App.UWP/Eppie.App.UWP.csproj"
uno: "false"

runs-on: ubuntu-latest

env:
dotnet-version: '8.x'

steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
submodules: recursive

- name: Setup .NET
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
with:
dotnet-version: ${{ env.dotnet-version }}

- name: Setup the Uno Platform
if: matrix.uno == 'true'
uses: finebits/github-actions/devhub/uno-platform/setup@4a126d80a11c5fdc83ce884d3d23dffb30bc4495 # v2.0.0

- name: Verify format
run: dotnet format "${{ matrix.project }}" --verify-no-changes --severity=error
2 changes: 1 addition & 1 deletion source/Eppie.App/Eppie.App/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
global using System.Collections.Immutable;
global using System.Collections.Immutable;
global using CommunityToolkit.Mvvm.ComponentModel;
global using CommunityToolkit.Mvvm.Input;
global using Eppie.App.Models;
Expand Down

0 comments on commit 550a385

Please sign in to comment.