Skip to content

Commit 7dd8e8c

Browse files
committed
Update build.yml
1 parent 1558c82 commit 7dd8e8c

1 file changed

Lines changed: 52 additions & 35 deletions

File tree

.github/workflows/build.yml

Lines changed: 52 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,55 @@ jobs:
1515
version: [G8MJ01]
1616

1717
steps:
18-
# Checkout the repository
19-
- name: Checkout
20-
uses: actions/checkout@v4
21-
with:
22-
submodules: recursive
23-
24-
# Set Git config
25-
- name: Git config
26-
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
27-
28-
# Copy the original files to the workspace
29-
- name: Prepare
30-
run: cp -R /orig .
31-
32-
# Build the project
33-
- name: Build
34-
run: |
35-
python configure.py --map --version ${{ matrix.version }} \
36-
--binutils /binutils --compilers /compilers
37-
ninja all_source build/${{ matrix.version }}/progress.json \
38-
build/${{ matrix.version }}/report.json
39-
40-
# Upload map files
41-
- name: Upload map
42-
uses: actions/upload-artifact@v4
43-
with:
44-
name: ${{ matrix.version }}_maps
45-
path: build/${{ matrix.version }}/**/*.MAP
46-
47-
# Upload progress report
48-
- name: Upload report
49-
uses: actions/upload-artifact@v4
50-
with:
51-
name: ${{ matrix.version }}_report
52-
path: build/${{ matrix.version }}/report.json
18+
# Checkout the repository
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
submodules: recursive
24+
25+
# Set Git config
26+
- name: Git config
27+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
28+
29+
# Normalize file mod times
30+
- name: Restore timestamps
31+
run: |
32+
uv run https://raw.githubusercontent.com/MestreLion/git-tools/refs/tags/v2022.12/git-restore-mtime \
33+
--merge --commit-time
34+
35+
# Copy the original files to the workspace
36+
- name: Prepare
37+
run: cp -a /orig .
38+
39+
# Restore cached files
40+
- name: Cache build
41+
uses: actions/cache@v4
42+
with:
43+
path: |
44+
build
45+
.ninja_deps
46+
.ninja_log
47+
key: ${{ runner.os }}-${{ matrix.version }}-${{ github.sha }}
48+
restore-keys: ${{ runner.os }}-${{ matrix.version }}-
49+
50+
# Build the project
51+
- name: Build
52+
run: |
53+
python configure.py --map --version ${{ matrix.version }} \
54+
--binutils /binutils --compilers /compilers
55+
ninja all_source progress build/${{ matrix.version }}/report.json
56+
57+
# Upload map files
58+
- name: Upload map
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: ${{ matrix.version }}_maps
62+
path: build/${{ matrix.version }}/**/*.MAP
63+
64+
# Upload progress report
65+
- name: Upload report
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: ${{ matrix.version }}_report
69+
path: build/${{ matrix.version }}/report.json

0 commit comments

Comments
 (0)