forked from digibyte/digibyte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request digibyte#39 from SmartArray/tests/ci_workflow
Continuous Integration: GitHub Workflow
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: 'Build and check' | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
os: [x86_64-linux-gnu] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache apt depencenies | ||
uses: actions/cache@v2 | ||
id: cache-apt | ||
with: | ||
path: "~/apt-cache" | ||
key: apt-cache | ||
|
||
- name: Cache depends | ||
id: cache-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: depends/${{ matrix.os }} | ||
key: ${{ matrix.os }}-${{ hashFiles('depends/packages/*.mk') }} | ||
|
||
- name: Install apt dependencies | ||
env: | ||
CACHE_HIT: ${{steps.cache-apt.outputs.cache-hit}} | ||
DEPS: build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git ca-certificates ccache | ||
run: | | ||
if [[ "$CACHE_HIT" == 'true' ]]; then | ||
sudo cp --force --recursive ~/apt-cache/* / | ||
else | ||
sudo apt-get update && sudo apt-get install -yq $DEPS | ||
mkdir -p ~/apt-cache | ||
for dep in $DEPS; do | ||
dpkg -L $dep | while IFS= read -r f; do if test -f $f; then echo $f; fi; done | xargs cp --parents --target-directory ~/apt-cache/ | ||
done | ||
fi | ||
- name: Build depends | ||
if: steps.cache-dependencies.outputs.cache-hit != 'true' && steps.cache-apt.outputs.cache-hit != 'true' | ||
run: cd depends/ && make -j4 HOST=${{matrix.os}} | ||
|
||
- name: Auto generate | ||
run: ./autogen.sh | ||
|
||
- name: configure | ||
run: ./configure --with-incompatible-bdb --prefix=`pwd`/depends/${{ matrix.os }} | ||
|
||
- name: make | ||
run: make -j4 | ||
|
||
- name: check | ||
run: make check | ||
|