Merge GLONASS into tightly (GPS+SBAS+QZSS) #825
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 of firmware and tools | |
on: [push, pull_request] | |
env: | |
SDCC: 3.3.0 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: before_setup | |
env: | |
SDCC_DIR: /tmp/sdcc-${{env.SDCC}} | |
run: | | |
echo "SDCC_DIR=${SDCC_DIR}" >> $GITHUB_ENV | |
echo "${SDCC_DIR}/bin" >> $GITHUB_PATH | |
echo "DEPLOY_MESSAGE=\"build by Github actions, `ruby -e 'require "time"; print Time::parse(\`git log --format="%cd" -n 1\`.chomp).strftime("%Y%m%d_%H%M%S")'`\"" >> $GITHUB_ENV | |
case $(cat /etc/issue | sed -E "s/^[^0-9]*([0-9]+\.[0-9]+\.[0-9]+).*$/\1/") in | |
18.04*) | |
;; | |
*) | |
sudo sh -c "echo deb http://dk.archive.ubuntu.com/ubuntu/ xenial main >> /etc/apt/sources.list"; | |
sudo sh -c "echo deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe >> /etc/apt/sources.list"; | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5; | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32;; | |
esac | |
sudo apt-get update && sudo apt-get install -yq gcc-5 g++-5 libboost-all-dev g++-arm-linux-gnueabihf | |
- name: cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{env.SDCC_DIR}} | |
key: sdcc-${{env.SDCC}} | |
- name: setup_sdcc | |
run: | | |
chmod +x ./scripts/build-sdcc.sh | |
CC=gcc-5 CXX=g++-5 ./scripts/build-sdcc.sh | |
- name: make | |
run: | | |
(cd ./firmware/ver1 && make clean all) | |
(cd ./firmware/ver2 && make clean all) | |
(mkdir -p ./firmware/build && cp `find firmware -name "*.hex" -o -name "*.omf"` ./firmware/build/) | |
(cd ./tool/test && make clean all) | |
(cd ./tool && make clean all && (cd build_GCC && touch ${GITHUB_SHA}.commit && tar zvcf ubuntu.${GITHUB_REF##*/}.tar.gz *.out *.commit) ) | |
(cd ./tool && BUILD_DIR=build_GCC_ARM CXX=arm-linux-gnueabihf-g++ make clean all && (cd build_GCC_ARM && touch ${GITHUB_SHA}.commit && tar zvcf raspi.${GITHUB_REF##*/}.tar.gz *.out *.commit) ) | |
- name: upload_artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
path: | | |
tool/build_*/*.tar.gz | |
- name: deploy_to_archives | |
run: | | |
(mkdir -p /tmp/artifacts/${GITHUB_REPOSITORY##*/}/tool && cp -t /tmp/artifacts/${GITHUB_REPOSITORY##*/}/tool/ $(find ./tool -path "./tool/build_*" -a -name "*.tar.gz") ) | |
(curl -fL -o /tmp/ghcp.zip https://github.com/int128/ghcp/releases/download/v1.8.0/ghcp_linux_amd64.zip && unzip -d /tmp /tmp/ghcp.zip) | |
(cd /tmp/artifacts && /tmp/ghcp commit -u fenrir-naru -r archives -m ${{env.DEPLOY_MESSAGE}} --token=${{secrets.DEPLOY_TO_ARCHIVES_TOKEN}} $(find . -type f | sed -n 's|^\./||p') ) | |
- name: release_firmware | |
uses: fnkr/github-action-ghr@v1.3 | |
if: ${{ startsWith(github.ref, 'refs/tags/') && endsWith(github.ref, '+Firmware') }} | |
env: | |
GHR_PATH: firmware/build | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |