일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- ios
- 회고
- layoutSubviews
- AppStore
- YGEnums.h
- Xcode
- content-type
- Firebase
- Tuist
- SPM
- rc
- authentication
- fetchSignInMethods
- App Connect
- FlexLayout
- Automatic Reference Count
- playground
- Swift
- Tuist-Action
- UITest
- garbage collection
- Github-Action
- HealthKit
- HIG
- retain cycle
- arc
- Nan
- human interface guidelines
- alamofire
- pagination
- Today
- Total
멋있게걷는방법
[Tuist] Tuist Action 사용하기 [with. fetch Error] 본문
기존에 Github Action으로 CI를 구축할 땐 아래처럼 yml을 작성했습니다.
name: Swift
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
xcode-version: latest
- name: install tuist
run: curl -Ls https://install.tuist.io | bash
- name: project Generate
run: |
rm -rf .package.resolved
tuist generate
- name: Build
run: |
xcodebuild -project Choice.xcodeproj -scheme Choice -destination 'platform=iOS Simulator,name=iPhone 11 Pro,OS=latest'
하지만 Tuist 에선 Tuist Action 이라는 것을 지원하는데요,
Tuist Action 을 사용하면 더욱 간결한 코드를 아래와 같이 작성할 수 있습니다.
name: Swift
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: tuist/tuist-action@0.13.0
with:
command: 'fetch'
arguments: ''
- uses: tuist/tuist-action@0.13.0
with:
command: 'build'
arguments: ''
actions/checkout@v3
checkout 은 Github 에 올라가 있는 코드를 CI 서버로 내려받는 것이라고 이해할 수 있습니다.
즉 Github Action 을 쓸 때 이 checkout 명령어는 필수적이다라고 생각하면 될 것 같습니다.
뒤에 @v3 는 버전이므로 되도록 최신버전에 맞추는 것을 추천드립니다.
(Tuist 는 버전이 자주 바뀌어서 팀원들과 맞추는 게 좋다고 하네요)
tuist/tuist-action@0.13.0
이 액션을 사용하면 프로젝트를 빌드, 배포하기 위해 필요한 구성을 직접 할 필요가 없습니다.
기존 yml처럼 tuist 를 설치하고 generate 하고 어떻게 run 할 건지 직접 할 필요가 없는 것입니다!
- fetch
외부 Dependency 를 불러오는 작업입니다.
- build
프로젝트를 빌드합니다.
build 과정에선 코드의 warning과 Error에 대한 설명을 해주는 것 같습니다.
이렇게 따라해도 몇몇 분들은 에러가 나실 텐데..
만약,
Error: command failed: /Users/runner/work/Project_name/tuistexec fetch
와 같은 fetch 과정에서 에러가 난다면
현재 tuist version을 확인해야 합니다.
1. tuist local
명령어를 통해 로컬 환경 버전을 찾습니다.
2. tuist local 최신버전
명령어를 통해 local version을. tuist-version에 생성해 줍니다.
이렇게 해주면. tuist-version 파일이 생기고 내부에는 위에서 설정해 준 local version 이 쓰여있습니다.
이제 이걸 commit -> push 해주면 CI 가 다시 실행되면서 에러가 해결됩니다! 🙂
ref.
https://github.com/tuist/tuist-action/issues/6
https://docs.tuist.io/guides/continuous-integration/#github-actions
'Tuist' 카테고리의 다른 글
[Tuist] Firebase 에러 해결(with. _OBJC_CLASS_$_JSContext) (0) | 2023.09.21 |
---|---|
[Tuist] FlexLayout - YGEnums.h' file not found 에러 해결 (0) | 2023.03.29 |