|
| 1 | +name: "FujiNet CI" |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + # Do not build tags. Do not build release branch |
| 6 | + branches: |
| 7 | + - "**" |
| 8 | + - "!release" |
| 9 | + tags: |
| 10 | + - "!**" |
| 11 | + |
| 12 | +jobs: |
| 13 | + tagged-release: |
| 14 | + name: "PlatformIO CI" |
| 15 | + runs-on: "ubuntu-latest" |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + target-platform: [ATARI, ADAM, APPLE, IEC-LOLIN-D32] |
| 19 | + |
| 20 | + steps: |
| 21 | + - name: Checkout Source |
| 22 | + uses: actions/checkout@v2 |
| 23 | + with: |
| 24 | + fetch-depth: 0 |
| 25 | + |
| 26 | + - name: Cache pip |
| 27 | + uses: actions/cache@v2 |
| 28 | + with: |
| 29 | + path: ~/.cache/pip |
| 30 | + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} |
| 31 | + restore-keys: | |
| 32 | + ${{ runner.os }}-pip- |
| 33 | +
|
| 34 | + - name: Cache PlatformIO |
| 35 | + uses: actions/cache@v2 |
| 36 | + with: |
| 37 | + path: ~/.platformio |
| 38 | + key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} |
| 39 | + |
| 40 | + - name: Set up Python |
| 41 | + uses: actions/setup-python@v2 |
| 42 | + |
| 43 | + - name: Install PlatformIO |
| 44 | + run: | |
| 45 | + python -m pip install --upgrade pip |
| 46 | + pip install --upgrade platformio |
| 47 | + pip install Jinja2 |
| 48 | + pip install pyyaml |
| 49 | +
|
| 50 | + - name: Show python version |
| 51 | + run: python --version |
| 52 | + |
| 53 | + - name: Show pio system info |
| 54 | + run: pio system info |
| 55 | + |
| 56 | + - name: Show pio location |
| 57 | + run: pip show platformio |
| 58 | + |
| 59 | + - name: Create PlatformIO INI for Build |
| 60 | + run: cp /home/runner/work/fujinet-platformio/fujinet-platformio/.github/workflows/platformio.ini.${{ matrix.target-platform }} /home/runner/work/fujinet-platformio/fujinet-platformio/platformio.ini |
| 61 | + |
| 62 | + - name: Show platformio.ini |
| 63 | + run: cat /home/runner/work/fujinet-platformio/fujinet-platformio/platformio.ini |
| 64 | + |
| 65 | + - name: Get PIO build_board from INI |
| 66 | + id: build_board |
| 67 | + shell: bash |
| 68 | + run: | |
| 69 | + echo "NAME=$(grep '^[^;]*build_board ' /home/runner/work/fujinet-platformio/fujinet-platformio/.github/workflows/platformio.ini.${{ matrix.target-platform }} | sed s'/ //'g | cut -d "=" -f 2 | cut -d ";" -f 1)" >> $GITHUB_OUTPUT |
| 70 | +
|
| 71 | + # Build filesystem first so spiffs.bin is available during firmware build |
| 72 | + - name: Build Filesystem |
| 73 | + run: pio run -t buildfs -e ${{ steps.build_board.outputs.NAME }} |
| 74 | + |
| 75 | + # Build the firmware |
| 76 | + - name: Build Firimware |
| 77 | + run: pio run -e ${{ steps.build_board.outputs.NAME }} |
0 commit comments