Skip to content

Commit

Permalink
Merge pull request #56 from raccoongang/develop
Browse files Browse the repository at this point in the history
Develop to main. Github workflow.
  • Loading branch information
volodymyr-chekyrta authored Jul 19, 2023
2 parents 9978a1f + 8736b29 commit 1d1fdec
Show file tree
Hide file tree
Showing 12 changed files with 198 additions and 27 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @raccoongang/educationx-app-ios-reviewers
56 changes: 56 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Bug report for the EducationX IOS app
description: Report any issues that you have found with the EducationX IOS app. Please [check open issues](https://github.com/raccoongang/educationx-app-ios/issues) first, in case it has already been reported.
labels: [Bug]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
Please report security issues by email to security@raccoongang.com
- type: textarea
id: reproduction-steps
attributes:
label: Steps to reproduce
description: Please attach screenshots, videos or logs if you can.
placeholder: Tell us what you see!
value: |
1. Where are you starting? What can you see?
2. What do you click?
3. More steps…
validations:
required: true
- type: textarea
id: result
attributes:
label: Outcome
placeholder: Tell us what went wrong
value: |
#### What did you expect?
#### What happened instead?
validations:
required: true
- type: input
id: device
attributes:
label: Your phone model
placeholder: e.g. iPhoneX
validations:
required: false
- type: input
id: os
attributes:
label: Operating system version
placeholder: e.g. iOS14.7.1, under "software version"
validations:
required: false
- type: input
id: version
attributes:
label: Application version
description: You can find the version information in the Settings of EducationX IOS.
placeholder: |
e.g. Version: v1.2.2
validations:
required: false
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
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.
60 changes: 60 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Unit Tests

on:
workflow_dispatch:

push:
branches: [ develop ]

pull_request:

jobs:
tests:
name: Tests
runs-on: macos-13

concurrency:
# When running on develop, use the sha to allow all runs of this workflow to run concurrently.
# Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs.
group: ${{ github.ref == 'refs/heads/develop' && format('unit-tests-develop-{0}', github.sha) || format('unit-tests-{0}', github.ref) }}
cancel-in-progress: true

steps:
- uses: nschloe/action-cached-lfs-checkout@v1.2.1
with:
ref: ${{ github.event.pull_request.head.sha }}

- uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Setup environment
run:
source ci_scripts/ci_prepare_env.sh && setup_github_actions_environment

- run: |
xcversion installed
- name: SwiftLint
run:
bundle exec fastlane linting

- name: Run tests
run: bundle exec fastlane unit_tests

- name: Archive artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: test-output
path: fastlane/test_output
retention-days: 7
if-no-files-found: ignore

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
flags: unittests
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,6 @@ iOSInjectionProject/
.DS_Store
.idea
xcode-frameworks

vendor/
.bundle/
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ excluded: # paths to ignore during linting. Takes precedence over `included`.
- Discovery/DiscoveryTests
- Discussion/DiscussionTests
- Profile/ProfileTests
- vendor
# - Source/ExcludedFolder
# - Source/ExcludedFile.swift
# - Source/*/ExcludedFile.swift # Exclude files with a wildcard
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
source "https://rubygems.org"

gem "fastlane"
gem "xcode-install"
6 changes: 5 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ GEM
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.2.7)
fastlane (2.213.0)
fastlane (2.214.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand Down Expand Up @@ -196,6 +196,9 @@ GEM
unicode-display_width (1.8.0)
webrick (1.8.1)
word_wrap (1.0.0)
xcode-install (2.8.1)
claide (>= 0.9.1)
fastlane (>= 2.1.0, < 3.0.0)
xcodeproj (1.22.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
Expand All @@ -213,6 +216,7 @@ PLATFORMS

DEPENDENCIES
fastlane
xcode-install

BUNDLED WITH
2.4.10
26 changes: 0 additions & 26 deletions OpenEdX/Configuration.json

This file was deleted.

43 changes: 43 additions & 0 deletions ci_scripts/ci_prepare_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/sh

setup_xcode_cloud_environment () {
# Return on failures
# Fail when expanding unset variables
# Trace each command before executing it
set -eEu

# Move to the project root
cd ..

# Prevent installing dependencies in system directories
echo 'export GEM_HOME=$HOME/.gem' >>~/.zshrc
echo 'export PATH=$GEM_HOME/bin:$PATH' >>~/.zshrc
echo 'export PATH="/usr/local/opt/ruby@2.7/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/Users/local/Library/Python/3.9/bin:$PATH"' >> ~/.zshrc

export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH
export PATH="/usr/local/opt/ruby@2.7/bin:$PATH"
export PATH="/Users/local/Library/Python/3.9/bin:$PATH"

# Things don't work well on the default ruby version
brew install ruby@2.7

gem install bundler

bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
}

install_xcode_cloud_brew_dependencies () {
brew update && brew install xcodegen imagemagick
}

setup_github_actions_environment() {
brew update && brew install xcodegen git-lfs imagemagick

bundle config path vendor/bundle
bundle install --jobs 4 --retry 3

pod install
}
7 changes: 7 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

before_all do
xcversion(version: "~> 14.3")

ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "180"
ENV["FASTLANE_XCODE_LIST_TIMEOUT"] = "180"
end

lane :linting do
swiftlint(
mode: :lint,
Expand Down

0 comments on commit 1d1fdec

Please sign in to comment.