mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-03-22 05:41:54 +00:00
Still [having issues](https://github.com/firezone/firezone/actions/runs/3759257641) with the Elixir cache. Things tried that didn't work: - Namespacing by branch name. Github does this already. - Removing the `restore-keys` in order to only restore the cache if it's a direct hit. The `static_analysis` workflow runs `mix compile --force --warnings-as-errors` which doesn't use the build cache, so it's removed, which fixes the problem.
65 lines
1.7 KiB
YAML
65 lines
1.7 KiB
YAML
name: Test
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
unit-test:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
MIX_ENV: test
|
|
POSTGRES_HOST: localhost
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
services:
|
|
postgres:
|
|
image: postgres:15
|
|
ports:
|
|
- 5432:5432
|
|
env:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
steps:
|
|
- name: Install package dependencies
|
|
run: |
|
|
sudo apt-get install -q -y \
|
|
net-tools \
|
|
wireguard
|
|
- uses: actions/checkout@v3
|
|
- uses: erlef/setup-beam@v1
|
|
with:
|
|
otp-version: '25'
|
|
elixir-version: '1.14'
|
|
- uses: actions/cache@v3
|
|
name: Elixir Deps Cache
|
|
env:
|
|
cache-name: cache-elixir-deps
|
|
with:
|
|
path: deps
|
|
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ env.cache-name }}-
|
|
- uses: actions/cache@v3
|
|
name: Elixir Build Cache
|
|
env:
|
|
cache-name: cache-elixir-build
|
|
with:
|
|
path: _build
|
|
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
|
|
- name: Install Dependencies
|
|
run: mix deps.get --only $MIX_ENV
|
|
- name: Setup Database
|
|
run: |
|
|
mix ecto.create
|
|
mix ecto.migrate
|
|
- name: Run Tests and Upload Coverage Report
|
|
run: |
|
|
# XXX: This can fail when coveralls is down
|
|
mix coveralls.github --umbrella
|