From a768f509d8bdc470a9c6eee80794a099de6414b3 Mon Sep 17 00:00:00 2001 From: Wendy Liga <16457495+wendyliga@users.noreply.github.com> Date: Mon, 15 Jan 2024 11:51:38 +0700 Subject: [PATCH] update github actions --- .github/workflows/base.yml | 59 ++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 75 +++++++------------------------------- 2 files changed, 73 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/base.yml diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml new file mode 100644 index 0000000..b6ffae1 --- /dev/null +++ b/.github/workflows/base.yml @@ -0,0 +1,59 @@ +name: Base + +on: + workflow_call: + inputs: + os: + description: 'The OS to run the job on' + required: true + type: string + xcode: + description: 'The Xcode version to run the job on' + required: true + type: string + +jobs: + + build_library: + runs-on: ${{ inputs.os }} + steps: + - uses: actions/checkout@v3 + - name: Select Xcode ${{ inputs.xcode }} + run: sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode }}.app + - name: Run build + run: make build-library + - name: Run benchmark + run: make benchmark + + unit_test_library: + runs-on: ${{ inputs.os }} + steps: + - uses: actions/checkout@v3 + - name: Select Xcode ${{ inputs.xcode }} + run: sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode }}.app + - name: Run tests + run: make test-library + + unit_test_example: + runs-on: ${{ inputs.os }}} + steps: + - uses: actions/checkout@v3 + - name: Selext Xcode ${{ inputs.xcode }} + run: sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode }}.app + - name: Run tests + run: make test-example + + lint_podspec: + runs-on: ${{ inputs.os }}} + steps: + - uses: actions/checkout@v3 + - name: Selext Xcode ${{ inputs.xcode }} + run: sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode }}.app + - name: Install cocoapods + run: sudo gem install cocoapods + - name: Lint podspec + run: pod lib lint --allow-warnings --quick + + + + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6666cc..045752b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,66 +9,19 @@ on: - '*' jobs: - build_library: + build: strategy: matrix: - xcode: - - '14.3.1' - - '15.0.1' - runs-on: macos-13 - steps: - - uses: actions/checkout@v3 - - name: Select Xcode ${{ matrix.xcode }} - run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app - - name: Run build - run: make build-library - - name: Run benchmark - run: make benchmark - - unit_test_library: - strategy: - matrix: - xcode: - - '14.3.1' - - '15.0.1' - runs-on: macos-13 - steps: - - uses: actions/checkout@v3 - - name: Select Xcode ${{ matrix.xcode }} - run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app - - name: Run tests - run: make test-library - - unit_test_example: - strategy: - matrix: - xcode: - - '14.3.1' - - '15.0.1' - runs-on: macos-13 - steps: - - uses: actions/checkout@v3 - - name: Selext Xcode ${{ matrix.xcode }} - run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app - - name: Run tests - run: make test-example - - lint_podspec: - strategy: - matrix: - xcode: - - '14.3.1' - - '15.0.1' - runs-on: macos-13 - steps: - - uses: actions/checkout@v3 - - name: Selext Xcode ${{ matrix.xcode }} - run: sudo xcode-select -s /Applications/Xcode_14.1.app - - name: Install cocoapods - run: sudo gem install cocoapods - - name: Lint podspec - run: pod lib lint --allow-warnings --quick - - - - + include: + - os: macos-13 + xcode: '15.0.1' + - os: macos-13 + xcode: '14.3.1' + - os: macos-12 + xcode: '14.3.1' + - os: macos-12 + xcode: '13.4.1' + uses: ./.github/workflows/base.yml + with: + os: ${{ matrix.os }} + xcode: ${{ matrix.xcode }} \ No newline at end of file