Skip to content

Commit

Permalink
ci: add GitHub Action for SwiftLint checks
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
  • Loading branch information
pylapp committed Nov 4, 2024
1 parent 87d1526 commit cc26215
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ Because we want to define and provide an amazing design system for developers, w

The following chart explain how the review is done with also the intermediate alpha builds.
In few words, alpha builds are made for reviewers, and the merge is processed if and only if any review have been done.
The [task-list-completed GitHub app](https://github.com/apps/task-list-completed) prevents pull requests to be merged if some mandatory / not optional prerequisites are not filled.

```mermaid
flowchart TD
Expand All @@ -172,6 +171,13 @@ flowchart TD
L --> M(Update GitHub issue with details of beta build)
```

Pull requests will be merged if no conditions / prerequisites / checks are red (except DCO which is not - yet - mandatory, but we must at least outside contributors to apply it). Some _GitHub Actions_ workflows are defined:
- [task-list-completed GitHub app](https://github.com/apps/task-list-completed) prevents pull requests to be merged if some mandatory / not optional prerequisites are not filled ;
- another [workflow YAML](https://github.com/Orange-OpenSource/ouds-ios/blob/develop/.github/workflows/build-and-test.yml) building and testing the app / lib;
- another [using GitLeaks](https://github.com/Orange-OpenSource/ouds-ios/blob/develop/.github/workflows/gitleaks-action.yml) ensuring no screts are leaked ;
- the almost-optional-one checking [DCO is applied](https://probot.github.io/apps/dco/) ;
- and the one [for the linter warnings](https://github.com/cirruslabs/swiftlint-action).

## License

By contributing your code, you agree to license your contribution under the [MIT License](LICENSE).
4 changes: 3 additions & 1 deletion .github/DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,16 @@ Do not forget if possible to enable the warnings in the end of the file to reduc
### GitHub Action

We use also *GitHub Actions* so as to define a workflow with some actions to build demo application and test the library.
It will help use to ensure code on pull requests or being merged compiles and has all tests green.
It will help us to ensure code on pull requests or being merged compiles and has all tests green.
This workflow is defined in [this YAML](https://github.com/Orange-OpenSource/ouds-ios/blob/develop/.github/workflows/build-and-test.yml)

We have also a *gitleaks* workflow making some scans on the code to loook fo secrets leaks, defined in [this YAML](https://github.com/Orange-OpenSource/ouds-ios/blob/develop/.github/workflows/gitleaks-action.yml).

We use also two GitHub apps making controls on pull requests and defining wether or not prerequisites are filled or not.
There is on control to check if [PR template are all defined ](https://github.com/stilliard/github-task-list-completed), and one if [DCO is applied](https://probot.github.io/apps/dco/).

Finaly we have [this *GitHub Action*](https://github.com/cirruslabs/swiftlint-action) using _SwiftLint_ to ensure no warnings are in our codebase.

### GitLab CI (internal)

We use *GitLab CI*for CI/CD with our own runners so as to keep private our sensitive files likes certificates and provisioning profiles.
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Software Name: Orange Unified Design System
# SPDX-FileCopyrightText: Copyright (c) Orange SA
# SPDX-License-Identifier: MIT
#
# This software is distributed under the MIT license,
# the text of which is available at https://opensource.org/license/MIT/
# or see the "LICENSE" file for more details.
#
# Authors: See CONTRIBUTORS.txt
# Software description: A SwiftUI components library with code examples for Orange Unified Design System
#

name: SwiftLint

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
SwiftLint:
runs-on: ghcr.io/cirruslabs/macos-runner:sonoma
steps:
- uses: actions/checkout@v4
- uses: cirruslabs/swiftlint-action@v1
with:
version: latest
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased](https://github.com/Orange-OpenSource/ouds-ios/compare/0.5.0...develop)

### Added

- [Tool] GitHub Action to run SwiftLint for *main* and *develop* branches

## [0.5.0](https://github.com/Orange-OpenSource/ouds-ios/compare/0.4.1...0.5.0) - 2024-10-31

### Added
Expand Down

0 comments on commit cc26215

Please sign in to comment.