Skip to content

Commit 3bf7221

Browse files
committed
Fix #853, Use Cache to Avoid Duplicate Workflow Steps
1 parent 9c786d2 commit 3bf7221

File tree

2 files changed

+30
-50
lines changed

2 files changed

+30
-50
lines changed

.github/workflows/build-cfs-rtems4.11.yml

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,20 @@ jobs:
4545
# Set the type of machine to run on
4646
env:
4747
BUILDTYPE: ${{ matrix.buildtype }}
48+
ENABLE_UNIT_TESTS: true
4849
# Set home to where rtems is located
4950
HOME: /root
51+
# Disable mcopy check otherwise disk image build fails
52+
MTOOLS_SKIP_CHECK: 1
5053

5154
steps:
55+
- name: Cache Source and Build
56+
id: cache-src-bld
57+
uses: actions/cache@v4
58+
with:
59+
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
60+
key: rtems4.11-build-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.buildtype }}
61+
5262
# Check out the cfs bundle
5363
- name: Checkout code
5464
uses: actions/checkout@v4
@@ -80,33 +90,13 @@ jobs:
8090
matrix:
8191
buildtype: [debug, release]
8292

83-
# Set the type of machine to run on
84-
env:
85-
BUILDTYPE: ${{ matrix.buildtype }}
86-
ENABLE_UNIT_TESTS: true
87-
# Set home to where rtems is located
88-
HOME: /root
89-
# Disable mcopy check otherwise disk image build fails
90-
MTOOLS_SKIP_CHECK: 1
91-
9293
steps:
93-
# Checks out a copy of your repository on the ubuntu-latest machine
94-
- name: Checkout code
95-
uses: actions/checkout@v4
94+
- name: Cache Source and Build
95+
id: cache-src-bld
96+
uses: actions/cache@v4
9697
with:
97-
submodules: true
98-
99-
# Setup the build system
100-
- name: Copy Files
101-
run: |
102-
cp ./cfe/cmake/Makefile.sample Makefile
103-
cp -r ./cfe/cmake/sample_defs sample_defs
104-
105-
# Setup the build system
106-
- name: Make
107-
run: |
108-
make SIMULATION=i686-rtems4.11 prep
109-
make install
98+
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
99+
key: rtems4.11-build-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.buildtype }}
110100

111101
- name: Test
112102
#run: .github/scripts/qemu_test.sh && .github/scripts/log_failed_tests.sh

.github/workflows/build-cfs-rtems5.yml

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,20 @@ jobs:
4545
# Set the type of machine to run on
4646
env:
4747
BUILDTYPE: ${{ matrix.buildtype }}
48+
ENABLE_UNIT_TESTS: true
4849
# Set home to where rtems is located
4950
HOME: /root
51+
# Disable mcopy check otherwise disk image build fails
52+
MTOOLS_SKIP_CHECK: 1
5053

5154
steps:
55+
- name: Cache Source and Build
56+
id: cache-src-bld
57+
uses: actions/cache@v4
58+
with:
59+
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
60+
key: rtems5-build-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.buildtype }}
61+
5262
# Check out the cfs bundle
5363
- name: Checkout code
5464
uses: actions/checkout@v4
@@ -80,33 +90,13 @@ jobs:
8090
matrix:
8191
buildtype: [debug, release]
8292

83-
# Set the type of machine to run on
84-
env:
85-
BUILDTYPE: ${{ matrix.buildtype }}
86-
ENABLE_UNIT_TESTS: true
87-
# Set home to where rtems is located
88-
HOME: /root
89-
# Disable mcopy check otherwise disk image build fails
90-
MTOOLS_SKIP_CHECK: 1
91-
9293
steps:
93-
# Checks out a copy of your repository on the ubuntu-latest machine
94-
- name: Checkout code
95-
uses: actions/checkout@v4
94+
- name: Cache Source and Build
95+
id: cache-src-bld
96+
uses: actions/cache@v4
9697
with:
97-
submodules: true
98-
99-
# Setup the build system
100-
- name: Copy Files
101-
run: |
102-
cp ./cfe/cmake/Makefile.sample Makefile
103-
cp -r ./cfe/cmake/sample_defs sample_defs
104-
105-
# Setup the build system
106-
- name: Make
107-
run: |
108-
make SIMULATION=i686-rtems5 prep
109-
make install
98+
path: /home/runner/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/*
99+
key: rtems5-build-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.buildtype }}
110100

111101
- name: Test
112102
#run: .github/scripts/qemu_test.sh && .github/scripts/log_failed_tests.sh

0 commit comments

Comments
 (0)