My app is built with Elixir, and I use the bash uploader at the end of my Github Actions config:
# .github/workflows/elixir.yml
name: Elixir CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
MIX_ENV: test
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
MAILJET_API_KEY: ${{ secrets.MAILJET_API_KEY }}
MAILJET_SECRET_KEY: ${{ secrets.MAILJET_SECRET_KEY }}
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
strategy:
matrix:
elixir: [1.11.3]
otp: [23.3]
services:
postgres:
image: postgres:12
ports: ['5432:5432']
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-elixir@885971a72ed1f9240973bd92ab57af8c1aa68f24
with:
elixir-version: ${{ matrix.elixir }} # Define the elixir version [required]
otp-version: ${{ matrix.otp }} # Define the OTP version [required]
- name: Restore dependencies cache
uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Compilation
run: mix compile --warnings-as-errors
- name: Run Credo
run: mix credo --strict
- name: Run tests
run: mix coveralls.json
env:
DB_PASSWORD: postgres
DB_HOST: postgres
- name: Upload test coverage
id: codecov
run: bash <(curl -s https://codecov.io/bash)
I have never set up a codecov.yml file. But right now codecov is expecting test coverage for the test files as well - and I would like to ignore those. They are in a /test
directory. Can I do this with a command in the elixir.yml file, or do I need to set up a codecov.yml file for this? If the latter, are there online instructions I can follow for my case?