Combine artifacts into a single release zip #128
Workflow file for this run
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: CI | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
clang-format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run clang-format | |
run: | | |
curl -O https://raw.githubusercontent.com/Sarcasm/run-clang-format/master/run-clang-format.py | |
python ./run-clang-format.py -r module simulator src tests --style=file | |
run-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install ragel | |
run: sudo apt install ragel | |
- name: Run tests | |
run: | | |
cd tests | |
make test-travis | |
build-simulator: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install ragel | |
run: sudo apt install ragel | |
- name: Build simulator | |
run: | | |
cd simulator | |
make | |
build-firmware: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install ragel | |
run: sudo apt install ragel | |
- name: Prepare AVR32 toolchain | |
run: | | |
mkdir -p toolchain | |
cd toolchain | |
git clone https://github.com/monome/avr32-toolchain-linux.git deps/avr32-toolchain-linux | |
cd deps/avr32-toolchain-linux | |
tar xvfz avr32-gnu-toolchain-3.4.3.820-linux.any.x86_64.tar.gz | |
mv avr32-gnu-toolchain-linux_x86_64 $GITHUB_WORKSPACE/avr32-tools | |
chmod u+x $GITHUB_WORKSPACE/avr32-tools/bin/* | |
echo $GITHUB_WORKSPACE/avr32-tools/bin >> $GITHUB_PATH | |
unzip avr32-headers-6.2.0.742.zip -d $GITHUB_WORKSPACE/avr32-tools/avr32/include | |
- name: Build module firmware | |
run: | | |
cd module | |
make | |
- name: Create firmware artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: module/teletype.hex | |
name: teletype firmware | |
build-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Setup TinyTeX | |
uses: r-lib/actions/setup-tinytex@v2 | |
- name: Install dependencies | |
run: | | |
sudo apt-get install pandoc | |
pip install -r utils/requirements.pip | |
tlmgr install titlesec ulem | |
fmtutil-sys -all | |
- name: Build documentation | |
run: | | |
cd docs | |
make | |
- name: Create documentation artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: teletype docs | |
path: | | |
docs/teletype.pdf | |
docs/teletype.html | |
docs/cheatsheet.pdf | |
docs/cheatsheet-i2c.pdf | |
create-release-zip: | |
runs-on: ubuntu-latest | |
needs: [build-firmware, build-docs] | |
steps: | |
- name: Download artifacts from previous steps | |
uses: actions/download-artifact@v4 | |
with: | |
path: release | |
merge-multiple: true | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: module | |
- name: Add firmware update scripts to release | |
run: | | |
cp module/update_firmware.command release | |
cp module/flash.sh release | |
- name: Add release zip to artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
path: release | |
name: teletype.zip |