Skip to content

Commit

Permalink
Merge 52230b8 into b88a2fb
Browse files Browse the repository at this point in the history
  • Loading branch information
eyal0 committed Jan 6, 2021
2 parents b88a2fb + 52230b8 commit 763d17d
Showing 1 changed file with 116 additions and 44 deletions.
160 changes: 116 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- master
- auto_release
schedule:
- cron: '5 4 * * 1'

Expand Down Expand Up @@ -42,6 +43,9 @@ jobs:
echo "PKG_CONFIG_PATH=$HOME/.local/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$HOME/.local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
echo $GITHUB_JSON
env:
GITHUB_JSON: ${{ toJSON(github) }}
- name: Ubuntu specific setup
if: matrix.os == 'ubuntu'
run: |
Expand Down Expand Up @@ -216,24 +220,24 @@ jobs:
run: sed -i 's/-g /-g0 /g' Makefile
- name: Make pcb2gcode
run: make -j ${NUM_CPUS}
- name: Run examples
if: '! matrix.code_coverage'
run: |
pushd testing/gerbv_example
ls | parallel -k -j ${NUM_CPUS} --halt soon,fail=1 '
pushd {};
echo "Running on {}";
if [[ -f "no-valgrind" ]]; then
cat no-valgrind;
fi;
if [[ -f "no-valgrind" || "${{ matrix.os }}" != "ubuntu" ]]; then
time ../../../pcb2gcode || exit;
else
time valgrind --error-exitcode=127 --errors-for-leak-kinds=definite --leak-check=full -- ../../../pcb2gcode || exit;
fi;
echo "Finished on {}";
popd'
popd
#- name: Run examples
# if: '! matrix.code_coverage'
# run: |
# pushd testing/gerbv_example
# ls | parallel -k -j ${NUM_CPUS} --halt soon,fail=1 '
# pushd {};
# echo "Running on {}";
# if [[ -f "no-valgrind" ]]; then
# cat no-valgrind;
# fi;
# if [[ -f "no-valgrind" || "${{ matrix.os }}" != "ubuntu" ]]; then
# time ../../../pcb2gcode || exit;
# else
# time valgrind --error-exitcode=127 --errors-for-leak-kinds=definite --leak-check=full -- ../../../pcb2gcode || exit;
# fi;
# echo "Finished on {}";
# popd'
# popd
- name: Reset coverage
if: matrix.code_coverage
continue-on-error: true
Expand Down Expand Up @@ -261,25 +265,61 @@ jobs:
run: |
lcov --rc lcov_branch_coverage=1 -rc lcov_function_coverage --directory . --capture --no-external --output-file "pcb2gcode-lcov.info"
lcov --rc lcov_branch_coverage=1 -rc lcov_function_coverage -r "pcb2gcode-lcov.info" '*_tests.cpp' -o "pcb2gcode-lcov.info"
- name: Export coverage artifact
- name: Upload coverage artifact
if: matrix.code_coverage
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: lcov-${{ steps.sanitize-key.outputs.key }}
path: pcb2gcode-lcov.info
- name: Export build
uses: actions/upload-artifact@v1
- name: Prepare build for upload
run: |
mkdir pcb2gcode-$(./pcb2gcode --version | head -1)
mkdir pcb2gcode-$(./pcb2gcode --version | head -1)/.libs
cp ./pcb2gcode pcb2gcode-$(./pcb2gcode --version | head -1)
if [[ -e ~/.local/lib/libgerbv.so.1 ]]; then
cp -L ~/.local/lib/libgerbv.so.1 pcb2gcode-$(./pcb2gcode --version | head -1)/.libs;
fi
if [[ -e ~/.local/lib/libgeos-3.8.1.so ]]; then
cp -L ~/.local/lib/libgeos-3.8.1.so pcb2gcode-$(./pcb2gcode --version | head -1)/.libs;
fi
cat > pcb2gcode-$(./pcb2gcode --version | head -1)/pcb2gcode.sh << EOF
#!/bin/bash
if [[ \$EUID > 0 ]]; then MAYBE_SUDO=sudo; fi
export DEBIAN_FRONTEND=noninteractive
\$MAYBE_SUDO apt-get update -y
\$MAYBE_SUDO apt-get install -y libglib2.0-bin
\$MAYBE_SUDO apt-get install -y libgtkmm-2.4-1v5
LD_LIBRARY_PATH=\$PWD/.libs:\$LD_LIBRARY_PATH ./pcb2gcode "\$@"
EOF
chmod a+x pcb2gcode-$(./pcb2gcode --version | head -1)/pcb2gcode.sh
tar cvf pcb2gcode-${{ steps.sanitize-key.outputs.key }}.tar pcb2gcode-$(./pcb2gcode --version | head -1)
gzip pcb2gcode-${{ steps.sanitize-key.outputs.key }}.tar
- name: Upload build
uses: actions/upload-artifact@v2
with:
name: pcb2gcode-${{ steps.sanitize-key.outputs.key }}
path: pcb2gcode
path: pcb2gcode-${{ steps.sanitize-key.outputs.key }}.tar.gz
- name: Upload coverage to coveralls
if: matrix.code_coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: pcb2gcode-lcov.info
parallel: true

- name: Save version number
if: matrix.code_coverage
run: echo "$(./pcb2gcode --version | head -1)" > version.txt
- name: Upload version artifact
if: matrix.code_coverage
uses: actions/upload-artifact@v2
with:
name: version
path: version.txt

build-and-test-windows:
name: ${{ matrix.os }}_${{ matrix.boost }}_${{ matrix.compiler }}_${{ matrix.geos }}
strategy:
Expand Down Expand Up @@ -405,24 +445,24 @@ jobs:
|| (cat config.log && false)
- name: Make pcb2gcode
run: make -j ${NUM_CPUS}
- name: Run examples
if: '! matrix.code_coverage'
run: |
pushd testing/gerbv_example
ls | parallel -k -j ${NUM_CPUS} --halt soon,fail=1 '
pushd {};
echo "Running on {}";
if [[ -f "no-valgrind" ]]; then
cat no-valgrind;
fi;
time ../../../pcb2gcode || exit;
echo "Finished on {}";
popd'
popd
- name: Prepare for export
#- name: Run examples
# if: '! matrix.code_coverage'
# run: |
# pushd testing/gerbv_example
# ls | parallel -k -j ${NUM_CPUS} --halt soon,fail=1 '
# pushd {};
# echo "Running on {}";
# if [[ -f "no-valgrind" ]]; then
# cat no-valgrind;
# fi;
# time ../../../pcb2gcode || exit;
# echo "Finished on {}";
# popd'
# popd
- name: Prepare build for upload
run: |
mkdir bin
pushd bin
mkdir pcb2gcode-$(./pcb2gcode --version | head -1)
pushd pcb2gcode-$(./pcb2gcode --version | head -1)
cp ../pcb2gcode.exe .
mkdir .libs
pushd .libs
Expand Down Expand Up @@ -466,13 +506,14 @@ jobs:
cp /mingw64/bin/zlib1.dll .
popd
popd
tar cvf pcb2gcode-${{ steps.sanitize-key.outputs.key }}.tar pcb2gcode-$(./pcb2gcode --version | head -1)
env:
GEOS: ${{ matrix.geos }}
- name: Export build
uses: actions/upload-artifact@v1
- name: Upload build
uses: actions/upload-artifact@v2
with:
name: pcb2gcode-${{ steps.sanitize-key.outputs.key }}
path: bin
path: pcb2gcode-${{ steps.sanitize-key.outputs.key }}.tar
finalize-coverage:
needs: [build-and-test, build-and-test-windows]
name: Finalize coverage
Expand All @@ -487,3 +528,34 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
release:
needs: [build-and-test, build-and-test-windows]
name: release
runs-on: ubuntu-latest
steps:
- name: Download the artifacts to release
uses: actions/download-artifact@v2
- run: echo "PCB2GCODE_VERSION=$(cat version/version.txt)" >> $GITHUB_ENV
- name: Prepare the artifacts
run: |
mkdir -p pcb2gcode-{windows,ubuntu,macos}
mv pcb2gcode-windows_1_75_gplusplus_3.8.1/pcb2gcode-windows_1_75_gplusplus_3.8.1.tar pcb2gcode-windows/pcb2gcode-windows-${PCB2GCODE_VERSION}.tar
pushd pcb2gcode-windows
tar xvf pcb2gcode-windows-${PCB2GCODE_VERSION}.tar
zip -r pcb2gcode-windows-${PCB2GCODE_VERSION}.zip pcb2gcode-${PCB2GCODE_VERSION}
popd
mv pcb2gcode-ubuntu_1_66_gplusplus_3.8.1/pcb2gcode-ubuntu_1_66_gplusplus_3.8.1.tar.gz pcb2gcode-ubuntu/pcb2gcode-ubuntu-${PCB2GCODE_VERSION}.tar.gz
mv pcb2gcode-macos_1_75_gplusplus_3.8.1/pcb2gcode-macos_1_75_gplusplus_3.8.1.tar.gz pcb2gcode-macos/pcb2gcode-macos-${PCB2GCODE_VERSION}.tar.gz
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
files: |
pcb2gcode-windows/pcb2gcode-windows-${{ env.PCB2GCODE_VERSION }}.zip
pcb2gcode-ubuntu/pcb2gcode-ubuntu-${{ env.PCB2GCODE_VERSION }}.tar.gz
pcb2gcode-macos/pcb2gcode-macos-${{ env.PCB2GCODE_VERSION }}.tar.gz

0 comments on commit 763d17d

Please sign in to comment.