Skip to content

Commit

Permalink
Improve GH Actions workflows (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
Widcket committed Sep 18, 2023
1 parent 83eca90 commit 9b05042
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 26 deletions.
12 changes: 2 additions & 10 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ runs:

- id: restore-carthage-cache
name: Restore Carthage cache
uses: actions/cache/restore@v3
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: Carthage
key: carthage-${{ inputs.platform }}-${{ hashFiles('Cartfile.resolved') }}-${{ hashFiles('.xcode-version') }}-v1
Expand All @@ -36,16 +36,8 @@ runs:
run: carthage bootstrap --platform ${{ inputs.platform }} --use-xcframeworks --no-use-binaries --cache-builds
shell: bash

- name: Save Carthage cache
id: save-carthage-cache
uses: actions/cache/save@v3
if: steps.restore-carthage-cache.outputs.cache-hit != 'true'
with:
path: Carthage
key: carthage-${{ inputs.platform }}-${{ hashFiles('Cartfile.resolved') }}-${{ hashFiles('.xcode-version') }}-v1

- name: Run tests
uses: mxcl/xcodebuild@v2
uses: mxcl/xcodebuild@6e60022a0cbe8c89278be2dd1773a2f68e7c5c87
with:
xcode: ${{ inputs.xcode }}
scheme: ${{ inputs.scheme }}
Expand Down
20 changes: 4 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test on ${{ matrix.platform.os }} using Xcode ${{ matrix.xcode }}
Expand Down Expand Up @@ -48,10 +52,6 @@ jobs:
if: ${{ matrix.platform.os == 'iOS' }}
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d

- name: Cancel wokflow on failure
uses: andymckay/cancel-action@b9280e3f8986d7a8e91c7462efc0fa318010c8b1
if: ${{ failure() }}

test-package:
name: Test Swift package using Xcode ${{ matrix.xcode }}
runs-on: macos-latest
Expand All @@ -73,10 +73,6 @@ jobs:
- name: Run tests
run: swift test

- name: Cancel wokflow on failure
uses: andymckay/cancel-action@b9280e3f8986d7a8e91c7462efc0fa318010c8b1
if: ${{ failure() }}

pod-lint:
name: Lint podspec using Xcode ${{ matrix.xcode }}
runs-on: macos-latest
Expand All @@ -98,10 +94,6 @@ jobs:
- name: Run pod lib lint
run: bundle exec pod lib lint --allow-warnings --fail-fast

- name: Cancel wokflow on failure
uses: andymckay/cancel-action@b9280e3f8986d7a8e91c7462efc0fa318010c8b1
if: ${{ failure() }}

swiftlint:
name: Lint code with SwiftLint
runs-on: macos-latest
Expand All @@ -112,7 +104,3 @@ jobs:

- name: Run SwiftLint
run: swiftlint lint --reporter github-actions-logging

- name: Cancel wokflow on failure
uses: andymckay/cancel-action@b9280e3f8986d7a8e91c7462efc0fa318010c8b1
if: ${{ failure() }}

0 comments on commit 9b05042

Please sign in to comment.