Skip to content

Commit

Permalink
fix(CI): update mac-os version for github workflow (#242)
Browse files Browse the repository at this point in the history
* feat: update mac-os version for github workflow

* fix: package conflicts

* fix: linter errors

* chore: change swift version

* chore: replace swift version step with official one

* fix: remove make install from CI and run validation instead (lint+tests)

* feat: move linter to dedicated workflow

* feat: includes fastlane in gem file

* fix: naming for ci-validation

* fix: install variants before running tests

* fix: update make path destination

* fix: make path set order

* fix: path installation for non linux

* fix: set python version on github runner

* feat: update gyb to python3

* fix: templates and utils pathing

* chore: add temp value to test pipeline

* chore: checking path for template in CI

* chore: add more debugging for method in CI

* chore: add more logging

* chore: remove CI logging prints

* fix: install bundler before bundle install

* fix: disable coverage report due to issues with racc installation

* docs: update documentation about Python version from 2.7 to 3
  • Loading branch information
GMinucci authored Jan 17, 2025
1 parent e6063f3 commit a9ca453
Show file tree
Hide file tree
Showing 17 changed files with 413 additions and 216 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,29 @@ on:
branches: [ develop ]

env:
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer

jobs:
tests:
name: Test with Swift ${{ matrix.swift }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12]
swift: ["5.5"]
os: [macos-14]
swift: ["5.10"]

steps:
- uses: actions/checkout@v2
- uses: fwal/setup-swift@v1

- uses: swift-actions/setup-swift@v2
with:
swift-version: ${{ matrix.swift }}

- name: Make install
- name: Install variants
run: make install
- name: Tests
run: make test

- name: Run CI validation
run: make ci-validation

#
# CODECOV temporarily disabled due to issues running 'bundle install'
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source 'https://rubygems.org'

gem "fastlane"
gem "slather"
gem "nokogiri", ">= 1.13.2"
198 changes: 198 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,243 @@ GEM
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.1037.0)
aws-sdk-core (3.215.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.96.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.177.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.11.0)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
base64 (0.2.0)
claide (1.1.0)
clamp (1.3.2)
colored (1.2)
colored2 (3.1.2)
commander (4.6.0)
highline (~> 2.0.0)
concurrent-ruby (1.2.0)
declarative (0.0.20)
digest-crc (0.6.5)
rake (>= 12.0.0, < 14.0.0)
domain_name (0.6.20240107)
dotenv (2.8.1)
emoji_regex (3.2.3)
excon (0.112.0)
faraday (1.10.4)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0)
faraday-multipart (~> 1.0)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.0)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
faraday-retry (~> 1.0)
ruby2_keywords (>= 0.0.4)
faraday-cookie_jar (0.0.7)
faraday (>= 0.8.0)
http-cookie (~> 1.0.0)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.1.0)
multipart-post (~> 2.0)
faraday-net_http (1.0.2)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday_middleware (1.2.1)
faraday (~> 1.0)
fastimage (2.4.0)
fastlane (2.226.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
aws-sdk-s3 (~> 1.0)
babosa (>= 1.0.3, < 2.0.0)
bundler (>= 1.12.0, < 3.0.0)
colored (~> 1.2)
commander (~> 4.6)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 4.0)
excon (>= 0.71.0, < 1.0.0)
faraday (~> 1.0)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 1.0)
fastimage (>= 2.1.0, < 3.0.0)
fastlane-sirp (>= 1.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-apis-androidpublisher_v3 (~> 0.3)
google-apis-playcustomapp_v1 (~> 0.1)
google-cloud-env (>= 1.6.0, < 2.0.0)
google-cloud-storage (~> 1.31)
highline (~> 2.0)
http-cookie (~> 1.0.5)
json (< 3.0.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (>= 2.0.0, < 3.0.0)
naturally (~> 2.2)
optparse (>= 0.1.1, < 1.0.0)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.5)
simctl (~> 1.6.3)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (~> 3)
tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.4.0)
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
fastlane-sirp (1.0.0)
sysrandom (~> 1.0)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.54.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-core (0.11.3)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
mini_mime (~> 1.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.a)
rexml
google-apis-iamcredentials_v1 (0.17.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-playcustomapp_v1 (0.13.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-storage_v1 (0.31.0)
google-apis-core (>= 0.11.0, < 2.a)
google-cloud-core (1.7.1)
google-cloud-env (>= 1.0, < 3.a)
google-cloud-errors (~> 1.0)
google-cloud-env (1.6.0)
faraday (>= 0.17.3, < 3.0)
google-cloud-errors (1.4.0)
google-cloud-storage (1.47.0)
addressable (~> 2.8)
digest-crc (~> 0.4)
google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.31.0)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
googleauth (1.8.1)
faraday (>= 0.17.3, < 3.a)
jwt (>= 1.4, < 3.0)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
highline (2.0.3)
http-cookie (1.0.8)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jmespath (1.6.2)
json (2.9.1)
jwt (2.10.1)
base64
mini_magick (4.13.2)
mini_mime (1.1.5)
mini_portile2 (2.8.8)
minitest (5.17.0)
multi_json (1.15.0)
multipart-post (2.4.1)
nanaimo (0.3.0)
naturally (2.2.1)
nokogiri (1.13.8)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nokogiri (1.13.8-arm64-darwin)
racc (~> 1.4)
nokogiri (1.13.8-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.13.8-x86_64-linux)
racc (~> 1.4)
optparse (0.6.0)
os (1.1.4)
plist (3.7.2)
public_suffix (5.1.1)
racc (1.6.0)
rake (13.2.1)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.2.5)
rouge (3.28.0)
ruby2_keywords (0.0.5)
rubyzip (2.4.1)
security (0.1.5)
signet (0.19.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.10)
CFPropertyList
naturally
slather (2.7.2)
CFPropertyList (>= 2.2, < 4)
activesupport
clamp (~> 1.3)
nokogiri (~> 1.12)
xcodeproj (~> 1.21)
sysrandom (1.0.5)
terminal-notifier (2.0.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
trailblazer-option (0.1.2)
tty-cursor (0.7.1)
tty-screen (0.8.2)
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uber (0.1.0)
unicode-display_width (2.6.0)
word_wrap (1.0.0)
xcodeproj (1.22.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
xcpretty (0.4.0)
rouge (~> 3.28.0)
xcpretty-travis-formatter (1.0.1)
xcpretty (~> 0.2, >= 0.0.7)

PLATFORMS
arm64-darwin-21
ruby
x86_64-darwin-21
x86_64-linux

DEPENDENCIES
fastlane
nokogiri (>= 1.13.2)
slather

Expand Down
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ else
detected_OS := $(shell uname)
endif

ifeq ($(detected_OS),Linux) # Linux only
prefix ?= ~/.local
else
prefix ?= /usr/local
endif

prefix ?= ~/.local
bindir ?= $(prefix)/bin
libdir ?= $(prefix)/lib
srcdir = Sources
Expand Down Expand Up @@ -72,6 +67,7 @@ endif

.PHONY: coverage
coverage: test
@gem install bundler
@bundle install
@bundle exec slather coverage --ignore ../**/*/Xcode\* --ignore Tests/\* --scheme VariantsCore Variants.xcodeproj/

Expand All @@ -83,3 +79,8 @@ lint:
validation: lint coverage
@rm -rf variants.yml
@echo "Ready to go."

.PHONY: ci-validation
ci-validation: test
@rm -rf variants.yml
@echo "Ready to go."
11 changes: 6 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let package = Package(
),
.package(
url: "https://github.com/jpsim/Yams.git",
from: "2.0.0"
from: "5.0.0"
),
.package(
name: "XcodeProj",
Expand All @@ -26,7 +26,7 @@ let package = Package(
),
.package(
url: "https://github.com/apple/swift-argument-parser.git",
from: "0.1.0"
from: "1.0.0"
),
.package(
url: "https://github.com/stencilproject/Stencil.git",
Expand All @@ -38,7 +38,9 @@ let package = Package(
from: "3.5.0"
),
.package(
url: "https://github.com/SimplyDanny/SwiftLintPlugins")
url: "https://github.com/realm/SwiftLint",
from: "0.58.0"
)
],
targets: [
.target(
Expand All @@ -48,8 +50,7 @@ let package = Package(
"Yams",
"XcodeProj",
.product(name: "ArgumentParser", package: "swift-argument-parser"),
"Stencil",
"SwiftLintPlugins"
"Stencil"
]
),
.target(
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ This file is responsible for:

### Dependencies

In order to generate the code from templates, Variants requires Python 2.7. We recommend configuring the python version using a version management tool such as Pyenv.
In order to generate the code from templates, Variants requires Python 3. We recommend configuring the python version using a version management tool such as Pyenv.

For details on how to install and use it check the [Pyenv repo](https://github.com/pyenv/pyenv).

### On Github Actions CI

See [Switching Variants on CI](docs/GITHUB_ACTION.md) for a better understanding and examples.

### Homebrew (recommended)
### Homebrew **(recommended)**

```sh
brew install backbase/m/variants
Expand All @@ -69,6 +69,16 @@ cd variants
make install
```

Once the installation is completed, the binary will be added to your `~/.local` folder. Make sure to have the folder included in your `PATH` variable. This should be done in the shell configuration file

Add the following to the `~/.zshrc` or `~/.bashrc` file:
```sh
export PATH=$HOME/.local/bin:/usr/local/bin:$PATH
```

Make sure to restart your terminal or source the changed file with `source ~/.zshrc` or `source ~/.bashrc`


### Swift Package Manager

#### Use as CLI
Expand Down
Loading

0 comments on commit a9ca453

Please sign in to comment.