Skip to content

Tests

Tests #1302

Workflow file for this run

name: Tests
on:
push:
branches: '*'
pull_request:
branches: main
# 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: erlang:24.3-alpine
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: deps
run: apk add --no-cache --updat autoconf automake bison build-base bzip2 cmake curl dbus-dev flex git gmp-dev libsodium-dev libtool linux-headers lz4 openssl-dev pkgconfig protoc sed tar wget vim
- name: rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: build
run: make
env:
CARGO_BUILD_RUSTFLAGS: -C target-feature=-crt-static
- name: build test
run: ./rebar3 as test compile
env:
CARGO_BUILD_RUSTFLAGS: -C target-feature=-crt-static
- name: tar
run: tar -cvzf build.tar.gz -C _build/ .
- name: upload-artifact
uses: actions/upload-artifact@v2
with:
name: build
path: build.tar.gz
xref:
needs: build
runs-on: ubuntu-latest
container:
image: erlang:24.3-alpine
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-xref
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: deps
run: apk add --no-cache --updat autoconf automake bison build-base bzip2 cmake curl dbus-dev flex git gmp-dev libsodium-dev libtool linux-headers lz4 openssl-dev pkgconfig protoc sed tar wget vim
- name: rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: build
run: make
- name: xref
run: ./rebar3 xref
eunit:
needs: build
runs-on: ubuntu-latest
container:
image: erlang:24.3-alpine
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-eunit
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: deps
run: apk add --no-cache --updat autoconf automake bison build-base bzip2 cmake curl dbus-dev flex git gmp-dev libsodium-dev libtool linux-headers lz4 openssl-dev pkgconfig protoc sed tar wget vim
- name: rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: build
run: make
- name: eunit
run: ./rebar3 eunit -v
dialyzer:
needs: build
runs-on: ubuntu-latest
container:
image: erlang:24.3-alpine
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-dialyzer
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: deps
run: apk add --no-cache --updat autoconf automake bison build-base bzip2 cmake curl dbus-dev flex git gmp-dev libsodium-dev libtool linux-headers lz4 openssl-dev pkgconfig protoc sed tar wget vim
- name: rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: build
run: make
- name: dialyzer
run: ./rebar3 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: erlang:24.3-alpine
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
services:
localstack:
image: localstack/localstack:1.4
env:
SERVICES: s3
ports:
- '4566-4583:4566-4583'
volumes:
- "/var/lib/localstack:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
env:
HPR_PACKET_REPORTER_LOCAL_HOST: ${{ secrets.HPR_PACKET_REPORTER_LOCAL_HOST }}
HPR_PACKET_REPORTER_LOCAL_PORT: ${{ secrets.HPR_PACKET_REPORTER_LOCAL_PORT }}
steps:
- name: checkout
uses: actions/checkout@v2
- name: deps
run: apk add --no-cache --updat autoconf automake bison build-base bzip2 cmake curl dbus-dev flex git gmp-dev libsodium-dev libtool linux-headers lz4 openssl-dev pkgconfig protoc sed tar wget vim python3 python3-dev py3-pip
- name: localstack
run: |
curl 'http://localstack:4566/health'
pip install awscli-local[ver1]
aws configure set aws_access_key_id testkey
aws configure set aws_secret_access_key testsecret
aws configure set default.region us-east-1
aws s3 mb s3://test-bucket --endpoint-url=http://localstack:4566
- name: rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: build
run: make
- name: ct
run: CT_LAGER=DEBUG ./rebar3 ct --suite=${{ matrix.suite }} --readable=true
release:
needs: build
runs-on: ubuntu-latest
container:
image: erlang:24.3-alpine
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-release
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: deps
run: apk add --no-cache --updat autoconf automake bison build-base bzip2 cmake curl dbus-dev flex git gmp-dev libsodium-dev libtool linux-headers lz4 openssl-dev pkgconfig protoc sed tar wget vim
- name: rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: download-artifact
uses: actions/download-artifact@v2
with:
name: build
- name: untar
run: |
mkdir _build
tar -xvf build.tar.gz -C _build
- name: build
run: make
- name: release
run: make rel