Tests #1752
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: Tests | |
on: | |
push: | |
branches: '*' | |
pull_request: | |
branches: master | |
# Run every day at midnight PST (0800 UTC) | |
# https://crontab.guru/#0_8_*_*_* | |
schedule: | |
- cron: '0 8 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: quay.io/team-helium/router: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/router/_build | |
cp -R /opt/router/_build/* /tmp/router/_build | |
cp -R * /tmp/router | |
rm -rf /opt/router/* | |
cp -R /tmp/router /opt | |
rm -rf /tmp/router | |
- name: build | |
run: | | |
make grpc | |
./rebar3 compile | |
working-directory: /opt/router | |
- name: build test | |
run: ./rebar3 as test compile | |
working-directory: /opt/router | |
- name: tar | |
run: tar -cvzf build.tar.gz -C _build/ . | |
working-directory: /opt/router | |
- name: upload-artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build | |
path: /opt/router/build.tar.gz | |
xref: | |
needs: build | |
runs-on: ubuntu-latest | |
container: | |
image: quay.io/team-helium/router: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: grpc | |
run: make grpc | |
- name: xref | |
run: make xref | |
eunit: | |
needs: build | |
runs-on: ubuntu-latest | |
container: | |
image: quay.io/team-helium/router: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: grpc | |
run: make grpc | |
- name: eunit | |
run: make eunit -v | |
dialyzer: | |
needs: build | |
runs-on: ubuntu-latest | |
container: | |
image: quay.io/team-helium/router: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: grpc | |
run: make grpc | |
- name: dialyzer | |
run: make dialyzer | |
suites: | |
runs-on: ubuntu-latest | |
outputs: | |
test_suites: ${{ steps.gen_test_suites.outputs.test_suites }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: gen_test_suites | |
id: gen_test_suites | |
run: | | |
SUITES="[" | |
for F in ./test/*_SUITE.erl | |
do | |
SUITES+="\"$(basename $F)\","; | |
done | |
# remove last comma | |
SUITES=${SUITES%,}; | |
# close array | |
SUITES+="]" | |
echo "We are in $(pwd)" | |
echo "::set-output name=test_suites::${SUITES}" | |
ct: | |
needs: [build, suites] | |
runs-on: ubuntu-latest | |
container: | |
image: quay.io/team-helium/router:CI | |
strategy: | |
fail-fast: false | |
matrix: | |
suite: "${{ fromJSON(needs.suites.outputs.test_suites) }}" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-ct-${{ matrix.suite }} | |
cancel-in-progress: true | |
env: | |
IC_APP_NAME: '${{ secrets.IC_APP_NAME }}' | |
IC_SCOPE_ID: '${{ secrets.IC_SCOPE_ID }}' | |
IC_API_KEY: '${{ secrets.IC_API_KEY }}' | |
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 ${{ matrix.suite }} | |
run: | | |
make grpc | |
CT_LAGER=DEBUG ./rebar3 ct --suite=${{ matrix.suite }} --readable=true |