Merge pull request #624 from markjfisher/tcp-server-err #1313
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: FujiNet PlatformIO CI | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target-platform: [ATARI, ADAM, APPLE] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache pip | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Cache PlatformIO | |
uses: actions/cache@v2 | |
with: | |
path: ~/.platformio | |
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
- name: Install PlatformIO | |
run: | | |
python -m pip install --upgrade pip | |
pip install --upgrade platformio | |
pip install Jinja2 | |
pip install pyyaml | |
- name: Show python version | |
run: python --version | |
- name: Show pio system info | |
run: pio system info | |
- name: Show pio location | |
run: pip show platformio | |
- name: Create INI ATARI for Build | |
if: ${{ matrix.target-platform == 'ATARI' }} | |
run: cp .github/workflows/platformio.ini.${{ matrix.target-platform }} platformio.ini | |
- name: Create INI ADAM for Build | |
if: ${{ matrix.target-platform == 'ADAM' }} | |
run: cp .github/workflows/platformio.ini.${{ matrix.target-platform }} platformio.ini | |
- name: Create INI APPLE for Build | |
if: ${{ matrix.target-platform == 'APPLE' }} | |
run: cp .github/workflows/platformio.ini.${{ matrix.target-platform }} platformio.ini | |
- name: Show platformio.ini | |
run: cat platformio.ini | |
- name: Install espressif32 platform | |
run: pio pkg install -p "platformio/espressif32@3.4.0" | |
- name: Fix up dirent.h top | |
run: gawk -i inplace '1;/#include\ <stdint.h>/{print "\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n"}' /home/runner/.platformio/packages/framework-espidf/components/newlib/platform_include/sys/dirent.h | |
- name: Fix up dirent.h bottom | |
run: printf "\n\n\n#ifdef __cplusplus\n}\n#endif\n\n" >> /home/runner/.platformio/packages/framework-espidf/components/newlib/platform_include/sys/dirent.h | |
- name: Verify dirent.h bottom | |
run: tail -n 10 /home/runner/.platformio/packages/framework-espidf/components/newlib/platform_include/sys/dirent.h | |
- name: Verify dirent.h top | |
run: head -n 30 /home/runner/.platformio/packages/framework-espidf/components/newlib/platform_include/sys/dirent.h | |
- name: ATARI Build | |
if: ${{ matrix.target-platform == 'ATARI' }} | |
run: pio run -e fujinet-atari-v1 | |
- name: ADAM Build | |
if: ${{ matrix.target-platform == 'ADAM' }} | |
run: pio run -e fujinet-adam-v1 | |
- name: APPLE Build | |
if: ${{ matrix.target-platform == 'APPLE' }} | |
run: pio run -e fujiapple-rev0 | |
- name: ATARI Build Filesystem | |
if: ${{ matrix.target-platform == 'ATARI' }} | |
run: pio run -t buildfs -e fujinet-atari-v1 | |
- name: ADAM Build Filesystem | |
if: ${{ matrix.target-platform == 'ADAM' }} | |
run: pio run -t buildfs -e fujinet-adam-v1 | |
- name: APPLE Build Filesystem | |
if: ${{ matrix.target-platform == 'APPLE' }} | |
run: pio run -t buildfs -e fujiapple-rev0 | |
- name: Build Filesystem | |
run: pio run -t buildfs -e fujinet-v1 | |
# - name: Show Build Artifacts | |
# run: ls -la .pio/build/fujinet-v1/*.bin | |
# boot_app0.bin is no longer used | |
# - name: Grab boot_app0.bin from github | |
# run: curl -o /home/runner/work/fujinet-platformio/fujinet-platformio/.pio/build/fujinet-v1/boot_app0.bin https://github.com/espressif/arduino-esp32/blob/1.0.6/tools/partitions/boot_app0.bin | |
# Disable artifacts for now. This will need to be different for each platform. Need to figure out how to do the JSON | |
# - name: Upload Build Artifacts | |
# uses: actions/upload-artifact@v2.3.1 | |
# with: | |
# name: fujinet-${{ matrix.target-platform }}-${{ steps.version.outputs.version }} | |
# path: | | |
# .pio/build/fujinet-v1/release.json | |
# .pio/build/fujinet-v1/sha256sums | |
# .pio/build/fujinet-v1/bootloader.bin | |
# .pio/build/fujinet-v1/firmware.bin | |
# .pio/build/fujinet-v1/partitions.bin | |
# .pio/build/fujinet-v1/spiffs.bin | |
# - name: Get Release Zip | |
# uses: actions/download-artifact@v2 | |
# with: | |
# name: fujinet-${{ matrix.target-platform }}-${{ steps.version.outputs.version }} | |
# | |
# - name: Show dir | |
# run: ls -la /home/runner/work/fujinet-platformio/fujinet-platformio | |
# | |
# - name: Get release shasum | |
# run: echo "::set-output name=shasum::$(sha256sum /home/runner/work/fujinet-platformio/fujinet-platformio/fujinet-${{ matrix.target-platform }}-${{ steps.version.outputs.version }}* | cut -d ' ' -f 1)" | |
# id: shasum | |
# | |
# - name: Create release.json | |
# run: sed "s/SHASUMHERE/${{ steps.shasum.outputs.shasum }}/" .pio/build/fujinet-v1/release.json.base > .pio/build/fujinet-v1/release.json | |
# | |
# - name: Upload release.json Artifact | |
# uses: actions/upload-artifact@v2.3.1 | |
# with: | |
# name: release.json | |
# path: .pio/build/fujinet-v1/release.json.base | |
# | |
# - name: Get Git Short SHA | |
# id: shortsha | |
# run: echo "::set-output name=shortsha::$(git rev-parse --short HEAD)" | |
# | |
# - name: Create Release | |
# uses: actions/create-release@v1 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# tag_name: ${{ steps.shortsha.outputs.shortsha }} | |
# release_name: ${{ steps.version.outputs.version }} | |
# body: "FujiNet build for ${{ matrix.target-platform }} - ${{ steps.version.outputs.version }}" | |
# | |
# - name: Create release ZIP | |
# uses: montudor/action-zip@v1 | |
# with: | |
# args: zip -qq -j fujinet-${{ matrix.target-platform }}-${{ steps.version.outputs.version }}.zip .pio/build/fujinet-v1/release.json .pio/build/fujinet-v1/sha256sums .pio/build/fujinet-v1/bootloader.bin .pio/build/fujinet-v1/firmware.bin .pio/build/fujinet-v1/partitions.bin .pio/build/fujinet-v1/spiffs.bin .pio/build/fujinet-v1/boot_app0.bin | |
# | |
# - name: Push ZIP to release | |
# uses: softprops/action-gh-release@v1 | |
# if: startsWith(${{ steps.shortsha.outputs.shortsha }}, 'refs/tags/') | |
# with: | |
# files: fujinet-${{ matrix.target-platform }}-${{ steps.version.outputs.version }}.zip | |
# | |
# - name: Notify FujiNet server | |
# run: sh -c 'echo "wget https://fujinet.online/?tag=${{ steps.version.outputs.version }}&platform=${{ matrix.target-platform }}"' | |
# end |