From c1b9ebe4af74a77f38880ab7e257f2d1f736f9df Mon Sep 17 00:00:00 2001 From: Stylianos Tzouvaras Date: Mon, 2 Dec 2024 15:44:22 +0200 Subject: [PATCH] added env to github action build-package --- .github/workflows/build-package.yml | 2 +- fastlane/Fastfile | 29 ++++++++++++++++++----------- fastlane/README.md | 10 +++++++++- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-package.yml b/.github/workflows/build-package.yml index a42ea61..b080012 100644 --- a/.github/workflows/build-package.yml +++ b/.github/workflows/build-package.yml @@ -15,4 +15,4 @@ jobs: xcode-version: '16.0' - uses: actions/checkout@v4 - run: - fastlane test \ No newline at end of file + fastlane test --env dev \ No newline at end of file diff --git a/fastlane/Fastfile b/fastlane/Fastfile index c93c2ee..903c97c 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -18,10 +18,27 @@ default_platform(:ios) platform :ios do desc "Run package tests with coverage" -lane :test do +lane :code_coverage do FileUtils.remove_dir "../xcov_output", true + test + + xcov( + scheme: ENV['SCHEME'], + output_directory: "xcov_output", + is_swift_package: true + ) + + if ENV['CI'] != 'true' + sh 'open ../xcov_output/index.html' + end + +end + +desc "Run package tests" +lane :test do + params = { package_path: '.', scheme: ENV['SCHEME'], @@ -35,16 +52,6 @@ lane :test do run_tests(params) - xcov( - scheme: ENV['SCHEME'], - output_directory: "xcov_output", - is_swift_package: true - ) - - if ENV['CI'] != 'true' - sh 'open ../xcov_output/index.html' - end - end desc "Deploy tags" diff --git a/fastlane/README.md b/fastlane/README.md index 467561c..c56d3a0 100644 --- a/fastlane/README.md +++ b/fastlane/README.md @@ -15,13 +15,21 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do ## iOS +### ios code_coverage + +```sh +[bundle exec] fastlane ios code_coverage +``` + +Run package tests with coverage + ### ios test ```sh [bundle exec] fastlane ios test ``` -Run package tests with coverage +Run package tests ### ios deploy