mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-03-21 23:41:58 +00:00
70 lines
1.6 KiB
YAML
70 lines
1.6 KiB
YAML
# Steps:
|
|
# 1. Unit/Integration Tests
|
|
# 2. Build and Push App Image
|
|
# 3. Functional Test
|
|
name: Test
|
|
on:
|
|
- push
|
|
jobs:
|
|
# 1. Unit/Integration Test
|
|
unit-integration-test:
|
|
runs-on: ubuntu-18.04
|
|
env:
|
|
MIX_ENV: test
|
|
POSTGRES_HOST: localhost
|
|
services:
|
|
postgres:
|
|
image: postgres:12
|
|
ports:
|
|
- 5432:5432
|
|
env:
|
|
POSTGRES_USER: fireguard
|
|
POSTGRES_PASSWORD: postgres
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Run Static Tests
|
|
uses: actions/setup-elixir@v1
|
|
with:
|
|
elixir-version: 1.10.2
|
|
otp-version: 22.3.2
|
|
- name: Install Dependencies
|
|
run: mix deps.get --only test
|
|
- name: Setup Database
|
|
run: |
|
|
mix ecto.create
|
|
mix ecto.migrate
|
|
- name: Run Tests
|
|
run: mix test
|
|
|
|
# 2. Build VM image
|
|
build-vm:
|
|
needs: unit-integration-test
|
|
runs-on: ubuntu-18.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Build VM Image
|
|
# uses: operatehappy/packer-github-action
|
|
# with:
|
|
# command: build
|
|
# arguments: "-color=false -on-error=abort"
|
|
# target: artifacts.pkr.json packer.json
|
|
run: |
|
|
echo `which packer`
|
|
echo 'Packer?'
|
|
|
|
# 3. Functional Test
|
|
functional-test:
|
|
needs: build-vm
|
|
runs-on: ubuntu-18.04
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Functional Test
|
|
run: |
|
|
echo 'Tests completed!'
|