Skip to content

Tests

Tests #922

Workflow file for this run

name: Tests
on:
push:
branches: master
pull_request:
branches: master
# Run every day at midnight PST (0800 UTC)
# https://crontab.guru/#0_8_*_*_*
schedule:
- cron: '0 8 * * *'
jobs:
build:
runs-on: ubuntu-latest
container:
image: quay.io/team-helium/packet_purchaser:CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
# For some reason the toolchain is no installed properly so lets add it...
- name: rustup default stable
run: rustup default stable
- name: checkout
uses: actions/checkout@v2
- name: cleanup
run: |
mkdir -p /tmp/packet_purchaser/_build
cp -R /opt/packet_purchaser/_build/* /tmp/packet_purchaser/_build
cp -R * /tmp/packet_purchaser
rm -rf /opt/packet_purchaser/*
cp -R /tmp/packet_purchaser /opt
rm -rf /tmp/packet_purchaser
- name: build
run: |
make grpc
./rebar3 compile
working-directory: /opt/packet_purchaser
- name: build test
run: ./rebar3 as test compile
working-directory: /opt/packet_purchaser
- name: tar
run: tar -cvzf build.tar.gz -C _build/ .
working-directory: /opt/packet_purchaser
- name: upload-artifact
uses: actions/upload-artifact@v2
with:
name: build
path: /opt/packet_purchaser/build.tar.gz
xref:
needs: build
runs-on: ubuntu-latest
container:
image: quay.io/team-helium/packet_purchaser:CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-xref
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: xref
run: make xref
eunit:
needs: build
runs-on: ubuntu-latest
container:
image: quay.io/team-helium/packet_purchaser:CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-eunit
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: eunit
run: make eunit -v
dialyzer:
needs: build
runs-on: ubuntu-latest
container:
image: quay.io/team-helium/packet_purchaser:CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-dialyzer
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: set-lockfile-hash
id: set_vars
run: |
rebar_hash="${{hashFiles(format('{0}{1}', github.workspace, '/rebar.lock'))}}"
echo "::set-output name=rebar_hash::$rebar_hash"
- name: cache PLT files
id: cache-plt
uses: actions/cache@v2
with:
path: |
_build/default/*_plt
_build/default/*_plt.hash
key: plt-cache-${{ steps.set_vars.outputs.rebar_hash }}
restore-keys: |
plt-cache-
- name: dialyzer
run: make dialyzer
ct:
needs: build
runs-on: ubuntu-latest
container:
image: quay.io/team-helium/packet_purchaser:CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-ct
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: ct
run: CT_LAGER=DEBUG make ct