-
Notifications
You must be signed in to change notification settings - Fork 3
100 lines (85 loc) · 3.38 KB
/
build.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
name: CI
on:
push:
branches: [ main ]
pull_request:
pull_request_target:
jobs:
format:
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork || github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.fork}}
runs-on: ubuntu-22.04
steps:
- name: Checkout PR
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target'}}
uses: actions/checkout@master
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Checkout
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@master
- name: Install tools
run: |
sudo apt update && sudo apt install clang-format-13
- name: Check formatting
run: |
make check_format
build:
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork || github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.fork}}
runs-on: ubuntu-22.04
steps:
- name: Checkout PR
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target'}}
uses: actions/checkout@master
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Checkout
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@master
- name: Checkout gh-pages
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@master
with:
path: gh-pages
ref: gh-pages
- name: Checkout agbcc
uses: actions/checkout@master
with:
path: agbcc
repository: SAT-R/agbcc
- name: Install tools
run: |
sudo apt update && sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi xorg-dev
python3 -m pip install gitpython
# build-essential, git, and libpng-dev are already installed
# gcc-arm-none-eabi is only needed for the modern build
# as an alternative to dkP
- name: Install agbcc
run: |
./build.sh
./install.sh ../
working-directory: agbcc
- name: Fetch assets
run: curl -o baserom.gba -u ${{ secrets.STORAGE_USERNAME }}:${{ secrets.STORAGE_PASSWORD }} ${{ secrets.STORAGE_URL }}/baserom.gba
- name: Compare
run: make -j${nproc}
- name: Progress
run: |
python3 scripts/progress.py text
- name: Generate reports
if: ${{ github.event_name == 'push' }}
run: |
mkdir -p gh-pages/reports
mkdir -p gh-pages/maps
python3 scripts/progress.py csv >> gh-pages/reports/progress-sa3-nonmatching.csv
python3 scripts/progress.py csv -m >> gh-pages/reports/progress-sa3-matching.csv
python3 scripts/progress.py shield-json > gh-pages/reports/progress-sa3-shield.json
echo "REPORTS_COMMIT_MSG=$( git log --format=%s ${GITHUB_SHA} )" >> $GITHUB_ENV
cp sa3.map gh-pages/maps/${GITHUB_SHA}.map
- name: Update reports
if: ${{ github.event_name == 'push' }}
uses: EndBug/add-and-commit@v7
with:
branch: gh-pages
cwd: "./gh-pages"
add: "reports maps"
message: ${{ env.REPORTS_COMMIT_MSG }}