-
Notifications
You must be signed in to change notification settings - Fork 12
135 lines (114 loc) · 4.54 KB
/
linux_cache.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Build Dependencies on Linux
on:
push:
branches: [master]
pull_request:
branches: [master]
repository_dispatch:
types:
- viennals-update-linux
- viennaray-update-linux
# Run this workflow every Sunday at 18:30 to refresh caches
schedule:
- cron: "30 18 * * 0"
workflow_dispatch:
env:
BUILD_TYPE: Debug
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
setup-viennals:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./viennals
steps:
- name: Checkout ViennaPS
uses: actions/checkout@v3
- name: Checkout ViennaLS
uses: actions/checkout@v3
with:
repository: ${{github.repository_owner}}/ViennaLS
path: ./viennals
- name: Store cache key in ENV
shell: bash
run: echo "VIENNALS_CACHE_KEY=viennals-dependency-cache-${{ runner.os }}-${{env.BUILD_TYPE}}-${{ hashFiles( './viennals/external/upstream/**CMakeLists.txt' ) }}" >> $GITHUB_ENV
- name: Check if cache key exists
uses: ./.github/actions/cache-check
id: cache-check
with:
cache-key: ${{env.VIENNALS_CACHE_KEY}}
token: ${{ secrets.PAT_CACHE }}
repository: ${{github.repository_owner}}/ViennaPS
- name: Clear Cache
if: ${{ github.event_name == 'schedule' && steps.cache-check.outputs.exists == 'true'}}
uses: ./.github/actions/cache-delete
with:
cache-key: ${{env.VIENNALS_CACHE_KEY}}
token: ${{ secrets.PAT_CACHE }}
repository: ${{github.repository_owner}}/ViennaPS
- name: Store cache refresh key in ENV
shell: bash
run: echo "VIENNALS_CACHE_REFRESH=${{ github.event_name == 'schedule' || steps.cache-check.outputs.exists != 'true' }}" >> $GITHUB_ENV
- name: Setup Cache for Build Dependencies
uses: actions/cache@v3
if: ${{ env.VIENNALS_CACHE_REFRESH == 'true' }}
id: viennals-dependency-cache
with:
key: ${{env.VIENNALS_CACHE_KEY}}
path: |
${{github.workspace}}/viennals/dependencies/Source
${{github.workspace}}/viennals/dependencies/Build
${{github.workspace}}/viennals/dependencies/Install
- name: Configure ViennaLS
if: ${{ env.VIENNALS_CACHE_REFRESH == 'true' }}
run: cmake -B ${{github.workspace}}/viennals/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build ViennaLS
if: ${{ env.VIENNALS_CACHE_REFRESH == 'true' }}
run: cmake --build ${{github.workspace}}/viennals/build
setup-viennaray:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./viennaray
steps:
- name: Checkout ViennaPS
uses: actions/checkout@v3
- name: Checkout ViennaRay
uses: actions/checkout@v3
with:
repository: ViennaTools/ViennaRay
path: ./viennaray
- name: Store cache key in ENV
run: echo "VIENNARAY_CACHE_KEY=viennaray-dependency-cache-${{ runner.os }}-${{env.BUILD_TYPE}}-${{ hashFiles( './viennaray/external/upstream/**CMakeLists.txt' ) }}" >> $GITHUB_ENV
- name: Check if cache key exists
uses: ./.github/actions/cache-check
id: cache-check
with:
cache-key: ${{env.VIENNARAY_CACHE_KEY}}
token: ${{ secrets.PAT_CACHE }}
repository: ${{github.repository_owner}}/ViennaPS
- name: Clear Cache
if: ${{ github.event_name == 'schedule' && steps.cache-check.outputs.exists == 'true'}}
uses: ./.github/actions/cache-delete
with:
cache-key: ${{env.VIENNARAY_CACHE_KEY}}
token: ${{ secrets.PAT_CACHE }}
repository: ${{github.repository_owner}}/ViennaPS
- name: Store cache refresh key in ENV
shell: bash
run: echo "VIENNARAY_CACHE_REFRESH=${{ github.event_name == 'schedule' || steps.cache-check.outputs.exists != 'true' }}" >> $GITHUB_ENV
- name: Setup Cache for Build Dependencies
if: ${{ env.VIENNARAY_CACHE_REFRESH == 'true' }}
uses: actions/cache@v3
id: viennaray-dependency-cache
with:
key: ${{env.VIENNARAY_CACHE_KEY}}
path: ${{github.workspace}}/viennaray/dependencies/Install
- name: Configure ViennaRay
if: ${{ env.VIENNARAY_CACHE_REFRESH == 'true' }}
run: cmake -B ./build -D CMAKE_BUILD_TYPE=${{env.build_type}}
- name: Build ViennaRay
if: ${{ env.VIENNARAY_CACHE_REFRESH == 'true' }}
run: cmake --build ${{github.workspace}}/viennaray/build