From 5ccac407e8f528f00cc295fa8627f219a1bac249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Coye=20de=20Brune=CC=81lis?= Date: Wed, 8 Nov 2023 10:37:27 +0100 Subject: [PATCH] ci: Minimalistic CI running tests on macOS and iOS --- .github/ISSUE_TEMPLATE/bug_report.md | 35 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 23 ++++++++++++++ .github/workflows/auto-author-assign.yml | 1 - .github/workflows/ci.yml | 38 +++++++++++++++++++++++ .github/workflows/semantic-commit.yml | 29 +++++++++++++++++ 5 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/semantic-commit.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..e006d75 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,35 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- + + + +**Description** +A clear and concise description of what the bug is. + +**Steps to reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone 12] + - iOS version: [e.g. iOS 14.0] + - App version: [e.g. 4.0.1] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..66a93f1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,23 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + + + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/auto-author-assign.yml b/.github/workflows/auto-author-assign.yml index 11c0c56..03608c3 100644 --- a/.github/workflows/auto-author-assign.yml +++ b/.github/workflows/auto-author-assign.yml @@ -1,4 +1,3 @@ -# .github/workflows/auto-author-assign.yml name: Auto Author Assign on: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e836239 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: CI workflow + +on: + pull_request: + branches: [ master ] + +jobs: + build_and_test_iOS: + name: Build and Test project on iOS + runs-on: [ self-hosted, iOS ] + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ github.token }} + - name: Checkout + uses: actions/checkout@v2 + - name: Build + run: swift build + - name: Test + run: swift test + + build_and_test_macOS: + name: Build and Test project on macOS + runs-on: [ self-hosted, macOS ] + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ github.token }} + - name: Checkout + uses: actions/checkout@v2 + - name: Build + run: swift build + - name: Test + run: swift test diff --git a/.github/workflows/semantic-commit.yml b/.github/workflows/semantic-commit.yml new file mode 100644 index 0000000..28b5a15 --- /dev/null +++ b/.github/workflows/semantic-commit.yml @@ -0,0 +1,29 @@ +name: 'PR and Commit Message Check' +on: + pull_request: + types: + - opened + - edited + - reopened + - synchronize + pull_request_target: + types: + - opened + - edited + - reopened + - synchronize + +jobs: + check-commit-message: + name: Check Commit Message + runs-on: ubuntu-latest + steps: + - name: Check Commit Message + uses: gsactions/commit-message-checker@v2 + with: + pattern: '^(feat|fix|chore|docs|style|refactor|perf|ci|test)(\(.+\))?: [A-Z0-9].+' + error: 'Commit messages and PR title should match conventional commit convention and start with a majuscule.' + excludeDescription: 'true' + excludeTitle: 'false' + checkAllCommitMessages: 'true' + accessToken: ${{ secrets.GITHUB_TOKEN }}