-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (37 loc) · 1.22 KB
/
linux.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
name: C/C++ linux
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Install
run: |
sudo apt-get update && sudo apt-get install gperf gettext automake autoconf libtool build-essential -y
autoconf --version
automake --version
aclocal --version
- uses: actions/checkout@v3
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
# 缓存的键,用于区分不同的缓存项
path: download
key: ${{ runner.os }}-download
- name: configure
run: mkdir build; cd build;cmake .. -DCMAKE_INSTALL_PREFIX=dist
- name: make
run: cd build; make
save_cache_job:
needs: build #Ensure this job runs after the first job
runs-on: ubuntu-22.04
steps:
# Post step to save the cache regardless of job status
- name: Save cache regardless of job status
if: always() # This ensures the step is executed regardless of job status
run: |
# This step is empty as it doesn't need to do anything
# The existence of this step with `if: always()` ensures the cache will be saved even if the job fails