Skip to content

Commit

Permalink
Merge pull request #538 from openedx/develop
Browse files Browse the repository at this point in the history
Develop to main. Release v2
  • Loading branch information
volodymyr-chekyrta authored Nov 11, 2024
2 parents 7b9010c + 255e2b7 commit ca40c1e
Show file tree
Hide file tree
Showing 497 changed files with 42,363 additions and 9,901 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: SwiftLint

on:
workflow_dispatch:

pull_request:

jobs:
lint:
name: Lint
runs-on: macos-latest

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('swiftlint-develop-{0}', github.sha) || format('swiftlint-{0}', github.ref) }}
cancel-in-progress: true

steps:
- uses: nschloe/[email protected]
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

- name: SwiftLint
run:
bundle exec fastlane linting
15 changes: 4 additions & 11 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ name: Unit Tests
on:
workflow_dispatch:

push:
branches: [ develop ]

pull_request:

jobs:
tests:
name: Tests
runs-on: macos-14
runs-on: macos-latest

concurrency:
# When running on develop, use the sha to allow all runs of this workflow to run concurrently.
Expand All @@ -24,7 +21,7 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
Expand All @@ -35,15 +32,11 @@ jobs:
run:
source ci_scripts/ci_prepare_env.sh && setup_github_actions_environment

- name: SwiftLint
run:
bundle exec fastlane linting

- name: Run tests
run: bundle exec fastlane unit_tests

- name: Archive artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: test-output
Expand All @@ -52,6 +45,6 @@ jobs:
if-no-files-found: ignore

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
flags: unittests
49 changes: 49 additions & 0 deletions .github/workflows/validate-translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Test Makefile

on:
workflow_dispatch:

push:
branches: [ develop ]

pull_request:

jobs:
translations:
name: "${{ matrix.case.name }}"
runs-on: macos-14

strategy:
matrix:
case:
- name: clean_translations
command: |
make clean_translations;
- name: extract_translations
command: |
make extract_translations;
echo "Ensure combined localization file exists";
test -f I18N/I18N/en.lproj/Localizable.strings;
- name: pull_translations
command:
make pull_translations;
echo "Files are split properly";
test -f Authorization/Authorization/uk.lproj/Localizable.strings;

steps:
- uses: nschloe/[email protected]
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Use Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install translations requirements
run: make translation_requirements

- name: "${{ matrix.case.name }}"
run: "${{ matrix.case.command }}"
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,11 @@ vendor/
venv/
Podfile.lock
config_settings.yaml
default_config/
default_config/

# Translations ignored files
.venv/
I18N/
*.lproj/
!en.lproj/
/config_script/__pycache__
12 changes: 11 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,24 @@ opt_in_rules: # some rules are only opt-in
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Carthage
- Pods
- Core/CoreTests
- Authorization/AuthorizationTests
- Course/CourseTests
- Dashboard/DashboardTests
- Discovery/DiscoveryTests
- Discussion/DiscussionTests
- Profile/ProfileTests
- WhatsNew/WhatsNewTests
- Theme/ThemeTests
- vendor
# - Source/ExcludedFolder
- Core/Core/SwiftGen
- Authorization/Authorization/SwiftGen
- Course/Course/SwiftGen
- Discovery/Discovery/SwiftGen
- Dashboard/Dashboard/SwiftGen
- Profile/Profile/SwiftGen
- WhatsNew/WhatsNew/SwiftGen
- Theme/Theme/SwiftGen
# - Source/ExcludedFile.swift
# - Source/*/ExcludedFile.swift # Exclude files with a wildcard
#analyzer_rules: # Rules run by `swiftlint analyze` (experimental)
Expand Down
Loading

0 comments on commit ca40c1e

Please sign in to comment.