From 71747c7625c9241c07d139339d6cb81e9057a57d Mon Sep 17 00:00:00 2001 From: Andrii Bodnar Date: Mon, 16 Oct 2023 17:04:44 +0300 Subject: [PATCH] ci: use GH Actions --- .github/workflows/build.yml | 93 +++++++++++++++++++++++++++++++++++ azure-pipelines.yml | 98 ------------------------------------- 2 files changed, 93 insertions(+), 98 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 azure-pipelines.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..3aa4ea1b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,93 @@ +name: CI/CD + +on: + push: + branches: + - 'refs/heads/*' + - '!refs/tags/*' + pull_request: + branches: + - '*' + paths: + - '*' + - '!README.md' + - '!LICENSE' + - '!CODE_OF_CONDUCT.md' + - '!CONTRIBUTING.md' + - '!website/**' + +jobs: + danger-swiftlint: + name: Danger SwiftLint + continue-on-error: true + runs-on: macos-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install SwiftLint and Danger Swift + run: | + brew install swiftlint + brew install danger/tap/danger-swift + export DANGER_GITHUB_API_TOKEN='${{ secrets.GH_TOKEN }}' + + - name: Run Danger SwiftLint + run: danger-swift ci + + pod-lint: + name: PodLint + needs: danger-swiftlint + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + + - name: Install CocoaPods + run: pod install + + - name: Lint pod library + run: pod lib lint --skip-tests --platforms=macos,ios,tvos + + build: + name: Build + needs: danger-swiftlint + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + + - name: Install CocoaPods + run: pod install + + - name: Build Xcode App + uses: actions/xcode@v3 + with: + actions: build + sdk: iphoneos + scheme: AppleReminders + configuration: Debug + xcWorkspacePath: Example/AppleReminders.xcworkspace + xcodeVersion: default + + test: + name: Test + needs: build + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + + - name: Install CocoaPods + run: pod install + + - name: Running tests + uses: actions/xcode@v3 + with: + actions: test + sdk: iphonesimulator + configuration: Debug + xcWorkspacePath: Tests/Tests.xcworkspace + scheme: Tests + xcodeVersion: default + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index a329dd93..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,98 +0,0 @@ -# Xcode -# Build, test, and archive an Xcode workspace on macOS. -# Add steps that install certificates, test, sign, and distribute the app, save build artifacts, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/xcode - -trigger: - branches: - include: - - refs/heads/* - exclude: - - refs/tags/* - paths: - exclude: - - README.md - - LICENSE - - CODE_OF_CONDUCT.md - - CONTRIBUTING.md - - website/** - -variables: - image: 'macOS-latest' - xCode: 'default' - -jobs: - - job: DangerSwiftLint - continueOnError: true - pool: - vmImage: $(image) - steps: - - bash: | - brew install swiftlint ; brew install danger/tap/danger-swift ; export DANGER_GITHUB_API_TOKEN='$(DANGER_GITHUB_API_TOKEN)' ; danger-swift ci - displayName: 'Danger SwiftLint' - - - job: PodLint - dependsOn: DangerSwiftLint - condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) - pool: - vmImage: $(image) - steps: - - task: CocoaPods@0 - inputs: - projectDirectory: Example - - bash: | - pod lib lint --skip-tests --platforms=macos,ios,tvos - displayName: 'Lint pod library' - - - job: Build - dependsOn: DangerSwiftLint - condition: succeeded() - pool: - vmImage: $(image) - steps: - - task: CocoaPods@0 - inputs: - projectDirectory: Example - - task: Xcode@5 - displayName: 'Build Xcode App' - inputs: - actions: 'build' - sdk: 'iphoneos' - scheme: 'AppleReminders' - configuration: 'Debug' - xcWorkspacePath: 'Example/AppleReminders.xcworkspace' - xcodeVersion: $(xCode) - packageApp: false - useXcpretty: true - - - job: Test - dependsOn: Build - condition: succeeded() - pool: - vmImage: $(image) - steps: - - checkout: self - persistCredentials: true - - task: CocoaPods@0 - inputs: - projectDirectory: Tests - - task: Xcode@5 - displayName: 'Running tests' - inputs: - actions: 'test' - sdk: 'iphonesimulator' - configuration: 'Debug' - xcWorkspacePath: 'Tests/Tests.xcworkspace' - scheme: 'Tests' - xcodeVersion: $(xCode) - publishJUnitResults: true - destinationPlatformOption: 'iOS' - destinationTypeOption: 'simulators' - destinationSimulators: 'iPhone 8' - - bash: | - cd Tests & bash <(curl -s https://codecov.io/bash) -t $(CODECOV_TOKEN) - displayName: 'Upload coverage to codecov.io' - - task: PublishTestResults@2 - inputs: - testResultsFiles: '**/junit.xml' - displayName: 'Publish tests results'