-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (85 loc) · 2.87 KB
/
build_test.yml
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
name: BuildAndTest
on:
pull_request:
branches:
- main
jobs:
test:
runs-on: macos-latest
env:
TUIST_VERSION: 4.12.1
steps:
- uses: jdx/mise-action@v2
- name: cache tuist
id: cache-tuist
uses: actions/cache@v4
with:
path: /Users/runner/.local/share/mise/installs/tuist/${{ env.TUIST_VERSION }}
key: ${{ runner.os }}-tuist@${{ env.TUIST_VERSION }}
- name: install tuist
if: steps.cache-tuist.outputs.cache-hit != 'true'
run: |
mise install tuist@${{ env.TUIST_VERSION }}
mise use -g tuist@${{ env.TUIST_VERSION }}
mise where tuist
- name: check paths
run: |
echo "tuist in installed in $(which tuist)"
- name: checkout project
uses: actions/checkout@v4
- name: fetch Secrets
uses: actions/checkout@v4
with:
repository: ${{ secrets.SECRETS_REPO }}
token: ${{ secrets.SECRETS_REPO_TOKEN }}
path: ${{ github.workspace }}/Secrets
- name: check secret files
run: |
echo "Checking configurations are loaded..."
- name: checkout package builds
id: cache-spm-build
uses: actions/cache@v4
with:
path: /Users/runner/spm_builds/.build
key: spm-build
- name: Link Cached Build to Project
if: steps.cache-spm-build.outputs.cache-hit == 'true'
run: |
cd Tuist
rsync -a /Users/runner/spm_builds/.build/ .build
- name: checkout Package.swift
id: cache-package-swift
uses: actions/cache@v4
with:
path: /Users/runner/spm_builds/Package.swift
key: spm-package
- name: Link Cached Packages.swift
id: check-diff-package-swift
if: steps.cache-package-swift.outputs.cache-hit == 'true'
run: >
cd Tuist
if diff /Users/runner/spm_builds/Package.swift Package.swift > /dev/null; then
echo "is_same=true" >> $GITHUB_ENV
else
echo "is_same=false" >> $GITHUB_ENV
fi
- name: Check installed Xcode version
run: |
xcodebuild -version
sudo xcode-select -switch /Applications/Xcode_16.1.app
xcodebuild -version
- name: Tuist install
if: >
(steps.check-diff-package-swift.outputs.is_same != 'true')
|| (steps.cache-spm-build.outputs.cache-hit != 'true')
|| (steps.cache-package-swift.outputs.cache-hit != 'true')
run: >
tuist install
mkdir -p /Users/runner/spm_builds
cp -r '${{ github.workspace }}/Tuist/.build' /Users/runner/spm_builds/.build
cp '${{ github.workspace }}/Tuist/Package.swift' /Users/runner/spm_builds/Package.swift
ls -l /Users/runner/spm_builds
- name: Test project
run: |
tuist test