summaryrefslogtreecommitdiff
path: root/.github/workflows/build.yml
blob: 091ae69b5fe73e6a563b64f07f2cc6689546e7b9 (plain)
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
name: CI

on:
  push:
    branches: [ master ]
  pull_request:

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      GAME_VERSION: FIRERED
      GAME_LANGUAGE: ENGLISH
      GAME_REVISION: 0
      MODERN: 0
      COMPARE: 1
    steps:
      - name: Checkout
        uses: actions/checkout@master

      - name: Checkout agbcc
        uses: actions/checkout@master
        with:
          path: 'agbcc'
          repository: 'pret/agbcc'

      - name: Checkout symbols
        uses: actions/checkout@master
        with:
          path: 'symbols'
          ref: 'symbols'

      - name: Install binutils
        run: sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi
        # 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: Compare FireRed
        run: |
          make -j${nproc} all syms

      - name: Compare FireRed rev1
        env:
          GAME_REVISION: 1
        run: |
          make -j${nproc} all syms

      - name: Compare LeafGreen
        env:
          GAME_VERSION: LEAFGREEN
        run: |
          make -j${nproc} all syms

      - name: Compare LeafGreen rev1
        env:
          GAME_VERSION: LEAFGREEN
          GAME_REVISION: 1
        run: |
          make -j${nproc} all syms

      - name: Build Modern
        env:
          MODERN: 1
          COMPARE: 0
        run: |
          make -j${nproc} all

      - name: Webhook
        if: ${{ github.event_name == 'push' }}
        env:
          CALCROM_DISCORD_WEBHOOK_USERNAME: OK
          CALCROM_DISCORD_WEBHOOK_AVATAR_URL: https://i.imgur.com/38BQHdd.png
          CALCROM_DISCORD_WEBHOOK_URL: ${{ secrets.CALCROM_DISCORD_WEBHOOK_URL }}
        run: sh .github/calcrom/webhook.sh pokefirered

      - name: Move symfiles
        if: ${{ github.event_name == 'push' }}
        run: |
          cp *.sym symbols/

      - name: Update symfiles
        if: ${{ github.event_name == 'push' }}
        uses: EndBug/add-and-commit@v7
        with:
          branch: symbols
          cwd: "./symbols"
          add: "*.sym"
          message: ${{ github.event.commits[0].message }}