2022-10-02 11:33:06 -07:00
|
|
|
name: LeoCAD CI
|
2022-09-25 18:16:10 -07:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ "master" ]
|
|
|
|
|
|
|
|
jobs:
|
2022-10-02 11:05:50 -07:00
|
|
|
build-ubuntu:
|
2022-09-25 18:16:10 -07:00
|
|
|
runs-on: ubuntu-latest
|
2022-10-02 11:05:50 -07:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install Qt
|
|
|
|
uses: jurplel/install-qt-action@v3
|
|
|
|
with:
|
|
|
|
cache: 'true'
|
|
|
|
- name: Get number of CPU cores
|
|
|
|
uses: SimenB/github-actions-cpu-cores@v1
|
|
|
|
id: cpu-cores
|
|
|
|
- name: Generate Makefile
|
|
|
|
run: qmake PREFIX=/usr
|
|
|
|
- name: Build
|
|
|
|
run: make -j ${{ steps.cpu-cores.outputs.count }}
|
2022-09-25 18:16:10 -07:00
|
|
|
|
2022-10-02 11:05:50 -07:00
|
|
|
build-macos:
|
|
|
|
runs-on: macos-latest
|
2022-09-25 18:16:10 -07:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-09-25 18:18:34 -07:00
|
|
|
- name: Install Qt
|
2022-09-25 18:23:12 -07:00
|
|
|
uses: jurplel/install-qt-action@v3
|
|
|
|
with:
|
2022-09-25 18:23:25 -07:00
|
|
|
cache: 'true'
|
2022-10-02 15:53:19 -07:00
|
|
|
- name: Cache Library
|
|
|
|
uses: actions/cache@v3
|
|
|
|
id: cache-library
|
|
|
|
with:
|
|
|
|
path: library.bin
|
2023-12-23 11:58:37 -08:00
|
|
|
key: library-23.06
|
2022-10-02 15:53:19 -07:00
|
|
|
- name: Download Library
|
|
|
|
if: steps.cache-library.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
2023-12-23 11:58:37 -08:00
|
|
|
wget https://github.com/leozide/leocad/releases/download/v23.03/Library-23.06.zip -O library.zip
|
2022-10-02 15:53:19 -07:00
|
|
|
unzip library.zip
|
|
|
|
- name: Cache POV-Ray
|
|
|
|
uses: actions/cache@v3
|
|
|
|
id: cache-povray
|
|
|
|
with:
|
|
|
|
path: povray
|
|
|
|
key: povray-20.03
|
|
|
|
- name: Download POV-Ray
|
|
|
|
if: steps.cache-povray.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
wget https://github.com/leozide/povray/releases/download/continuous/povray
|
|
|
|
chmod +x povray
|
|
|
|
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/leozide/leocad/commits/master -o repo.txt
|
|
|
|
echo < repo.txt
|
|
|
|
echo export REMOTE=$(grep -Po '(?<=: \")(([a-z0-9])\w+)(?=\")' -m 1 repo.txt)
|
|
|
|
export REMOTE=$(grep -Po '(?<=: \")(([a-z0-9])\w+)(?=\")' -m 1 repo.txt)
|
|
|
|
echo $REMOTE
|
2022-10-02 11:05:50 -07:00
|
|
|
- name: Get number of CPU cores
|
|
|
|
uses: SimenB/github-actions-cpu-cores@v1
|
|
|
|
id: cpu-cores
|
|
|
|
- name: Generate Makefile
|
2022-09-25 18:16:10 -07:00
|
|
|
run: qmake PREFIX=/usr
|
2022-10-02 11:05:50 -07:00
|
|
|
- name: Build
|
|
|
|
run: make -j ${{ steps.cpu-cores.outputs.count }}
|