-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
100 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,81 +15,81 @@ env: | |
TEST_RESULTS: './TestResults.xcresult' | ||
|
||
jobs: | ||
# build: | ||
# name: build | ||
# runs-on: [macos-15] | ||
# | ||
# steps: | ||
# - name: Checkout repository | ||
# uses: actions/checkout@v4 | ||
# | ||
# - name: build project | ||
# id: build | ||
# run: | | ||
# set -o pipefail | ||
# xcodebuild build-for-testing \ | ||
# -project ${{ env.PROJECT }} \ | ||
# -scheme ${{ env.SCHEME }} \ | ||
# -derivedDataPath ${{ env.DERIVED_DATA_PATH }} \ | ||
# -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.0' \ | ||
# CODE_SIGNING_ALLOWED='NO' | ||
# | ||
# mkdir TestData | ||
# patterns=("*.xctest" "*.app" "*.xctestrun" "*.framework" "*.bundle") | ||
# for pattern in "${patterns[@]}"; do find "${{ env.DERIVED_DATA_PATH }}" -name "$pattern" -print | pax -rw -pe "TestData"; done | ||
# echo "artifacts_path=TestData/${{ env.DERIVED_DATA_PATH }}" >> $GITHUB_OUTPUT | ||
# | ||
# - uses: actions/upload-artifact@v4 | ||
# with: | ||
# path: ${{ steps.build.outputs.artifacts_path }} | ||
# name: TestData | ||
# retention-days: 30 | ||
# | ||
# test: | ||
# name: Test | ||
# runs-on: [macos-15] | ||
# needs: build | ||
# | ||
# steps: | ||
# - name: Checkout repository | ||
# uses: actions/checkout@v4 | ||
# | ||
# - uses: actions/download-artifact@v4 | ||
# with: | ||
# name: TestData | ||
# path: ${{ env.DERIVED_DATA_PATH }} | ||
# | ||
# - name: Download Allure Parser of XCResults | ||
# run: | | ||
# curl -OL https://github.com/eroshenkoam/xcresults/releases/download/1.19.0/xcresults | ||
# chmod +x xcresults | ||
# | ||
# - name: Run Ui Tests | ||
# run: | | ||
# xcodebuild test-without-building \ | ||
# -xctestrun DerivedData/Build/Products/SwiftRadioUITests_iphonesimulator18.0-arm64.xctestrun \ | ||
# -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.0' \ | ||
# -resultBundlePath ./TestResults.xcresult \ | ||
# CODE_SIGNING_ALLOWED='NO' | ||
# continue-on-error: true | ||
# | ||
# - name: Generate Allure files | ||
# run: | | ||
# mkdir allure-results | ||
# ./xcresults export TestResults.xcresult -o allure-results | ||
# | ||
# - name: Upload artifact | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: allure-files | ||
# path: | | ||
# allure-results/ | ||
# retention-days: 7 | ||
build: | ||
name: build | ||
runs-on: [macos-15] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: build project | ||
id: build | ||
run: | | ||
set -o pipefail | ||
xcodebuild build-for-testing \ | ||
-project ${{ env.PROJECT }} \ | ||
-scheme ${{ env.SCHEME }} \ | ||
-derivedDataPath ${{ env.DERIVED_DATA_PATH }} \ | ||
-destination 'platform=iOS Simulator,name=iPhone 16,OS=18.0' \ | ||
CODE_SIGNING_ALLOWED='NO' | ||
mkdir TestData | ||
patterns=("*.xctest" "*.app" "*.xctestrun" "*.framework" "*.bundle") | ||
for pattern in "${patterns[@]}"; do find "${{ env.DERIVED_DATA_PATH }}" -name "$pattern" -print | pax -rw -pe "TestData"; done | ||
echo "artifacts_path=TestData/${{ env.DERIVED_DATA_PATH }}" >> $GITHUB_OUTPUT | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: ${{ steps.build.outputs.artifacts_path }} | ||
name: TestData | ||
retention-days: 30 | ||
|
||
test: | ||
name: Test | ||
runs-on: [macos-15] | ||
needs: build | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: TestData | ||
path: ${{ env.DERIVED_DATA_PATH }} | ||
|
||
- name: Download Allure Parser of XCResults | ||
run: | | ||
curl -OL https://github.com/eroshenkoam/xcresults/releases/download/1.19.0/xcresults | ||
chmod +x xcresults | ||
- name: Run Ui Tests | ||
run: | | ||
xcodebuild test-without-building \ | ||
-xctestrun DerivedData/Build/Products/SwiftRadioUITests_iphonesimulator18.0-arm64.xctestrun \ | ||
-destination 'platform=iOS Simulator,name=iPhone 16,OS=18.0' \ | ||
-resultBundlePath ./TestResults.xcresult \ | ||
CODE_SIGNING_ALLOWED='NO' | ||
continue-on-error: true | ||
|
||
- name: Generate Allure files | ||
run: | | ||
mkdir allure-results | ||
./xcresults export TestResults.xcresult -o allure-results | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: allure-files | ||
path: | | ||
allure-results/ | ||
retention-days: 7 | ||
|
||
report: | ||
runs-on: [ubuntu-latest] | ||
name: Report to Allure | ||
# needs: test | ||
needs: test | ||
steps: | ||
- name: Set up Homebrew | ||
id: set-up-homebrew | ||
|
@@ -98,32 +98,32 @@ jobs: | |
- name: Install Allure | ||
run: brew install allure | ||
|
||
# - name: Download artifact | ||
# uses: actions/download-artifact@v4 | ||
# with: | ||
# name: allure-files | ||
# path: ./ | ||
|
||
# - name: Load test report history | ||
# uses: actions/checkout@v3 | ||
# if: always() | ||
# continue-on-error: true | ||
# with: | ||
# ref: gh-pages | ||
# path: gh-pages | ||
# | ||
# - name: Build test report | ||
# uses: simple-elf/[email protected] | ||
# if: always() | ||
# with: | ||
# gh_pages: gh-pages | ||
# allure_history: allure-history | ||
# allure_results: allure-files/allure-results | ||
# | ||
# - name: Publish test report | ||
# uses: peaceiris/actions-gh-pages@v3 | ||
# if: always() | ||
# with: | ||
# github_token: ${{ secrets.TOKEN }} | ||
# publish_branch: gh-pages | ||
# publish_dir: allure-history | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: allure-files | ||
path: ./ | ||
|
||
- name: Load test report history | ||
uses: actions/checkout@v3 | ||
if: always() | ||
continue-on-error: true | ||
with: | ||
ref: gh-pages | ||
path: gh-pages | ||
|
||
- name: Build test report | ||
uses: simple-elf/[email protected] | ||
if: always() | ||
with: | ||
gh_pages: gh-pages | ||
allure_history: allure-history | ||
allure_results: allure-files/allure-results | ||
|
||
- name: Publish test report | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: always() | ||
with: | ||
github_token: ${{ secrets.TOKEN }} | ||
publish_branch: gh-pages | ||
publish_dir: allure-history |