Merge pull request #82 from eddbbt/fwport-1.1 #280
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: Build and Test | |
on: | |
# Run when pushing to stable branches | |
push: | |
branches: | |
- 'master' | |
- 'release-*' | |
# Run on branch/tag creation | |
create: | |
# Run on pull requests | |
pull_request: | |
env: | |
elixir_version: "1.14.5" | |
otp_version: "25.3.2" | |
jobs: | |
test-dialyzer: | |
name: Check Dialyzer | |
runs-on: ubuntu-22.04 | |
env: | |
MIX_ENV: ci | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v1 | |
with: | |
path: deps | |
key: ${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-mix- | |
- uses: actions/cache@v1 | |
with: | |
path: _build | |
key: ${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-_build-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-_build- | |
- uses: actions/cache@v1 | |
with: | |
path: dialyzer_cache | |
key: ${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-dialyzer_cache-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-dialyzer_cache- | |
- uses: erlef/setup-beam@v1.15 | |
with: | |
otp-version: ${{ env.otp_version }} | |
elixir-version: ${{ env.elixir_version }} | |
- name: Install Dependencies | |
run: mix deps.get | |
- name: Run dialyzer | |
# FIXME: This should be set to fail when dialyzer issues are fixed | |
run: mix dialyzer || exit 0 | |
test-coverage: | |
name: Build and Test | |
runs-on: ubuntu-22.04 | |
# Wait for Dialyzer to give it a go before building | |
needs: | |
- test-dialyzer | |
strategy: | |
fail-fast: false | |
matrix: | |
database: | |
- "cassandra:3.11.15" | |
- "scylladb/scylla:5.2.2" | |
services: | |
database: | |
image: ${{ matrix.database }} | |
ports: | |
- 9042:9042 | |
env: | |
MIX_ENV: test | |
CASSANDRA_DB_HOST: localhost | |
ASTARTE_CASSANDRA_NODES: localhost | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v1 | |
with: | |
path: deps | |
key: ${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-mix- | |
- uses: actions/cache@v1 | |
with: | |
path: _build | |
key: ${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-_build-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-_build- | |
- uses: erlef/setup-beam@v1.15 | |
with: | |
otp-version: ${{ env.otp_version }} | |
elixir-version: ${{ env.elixir_version }} | |
- name: Install Dependencies | |
run: mix deps.get | |
- name: Check formatting | |
run: mix format --check-formatted | |
- name: Compile | |
run: mix do compile | |
- name: Test and Coverage | |
run: mix coveralls.json --exclude wip -o coverage_results | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v1 |