🔀 :: (#401) CI 환경 구축 #50
Workflow file for this run
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
name: CI | |
on: | |
push: | |
branches: | |
- develop | |
- master | |
pull_request: | |
branches: | |
- "*" | |
env: | |
CACHED_DEPENDENCY_PATHS: ${{ github.workspace }}/Tuist/Dependencies | |
MASTER_KEY_PATH: Tuist/master.key | |
SECRET_XCCONFIG_PATH: Projects/App/XCConfig/Secrets.xcconfig | |
jobs: | |
prepare-ci: | |
name: ⚙️ Prepare CI | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install tuist | |
run: curl -Ls https://install.tuist.io | bash | |
- name: Compute dependency cache key | |
id: compute_hash | |
run: echo "hash=${{ hashFiles('Tuist/Dependencies.swift') }}" >> $GITHUB_OUTPUT | |
- name: Check dependency cache | |
uses: actions/cache@v3 | |
id: cache_dependencies | |
with: | |
path: ${{ env.CACHED_DEPENDENCY_PATHS }} | |
key: ${{ steps.compute_hash.outputs.hash }} | |
- name: Install dependencies needs | |
if: steps.cache_dependencies.outputs.cache-hit == '' | |
run: tuist fetch | |
outputs: | |
dependency_cache_key: ${{ steps.compute_hash.outputs.hash }} | |
test: | |
name: 🧪 Test | |
runs-on: macos-latest | |
needs: prepare-ci | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
xcode-version: latest | |
- name: Install tuist | |
run: curl -Ls https://install.tuist.io | bash | |
- name: Check dependency cache | |
uses: actions/cache@v3 | |
id: cache_dependencies | |
with: | |
path: ${{ env.CACHED_DEPENDENCY_PATHS }} | |
key: ${{ needs.prepare-ci.outputs.dependency_cache_key }} | |
- name: Install dependencies needs | |
if: steps.cache_dependencies.outputs.cache-hit != 'true' | |
run: tuist fetch | |
- name: Make `master.key` | |
run: | | |
touch ${{ env.MASTER_KEY_PATH }} | |
echo "${{ secrets.MASTER_KEY }}" > ${{ env.MASTER_KEY_PATH }} | |
- name: Make `Secrets.xcconfig` | |
run: | | |
mkdir Projects/App/XCConfig | |
touch ${{ env.SECRET_XCCONFIG_PATH }} | |
echo "" > ${{ env.SECRET_XCCONFIG_PATH }} | |
- name: Test with tuist | |
run: make test |