Created
July 20, 2022 20:33
-
-
Save superchris/4b6a5be08e880f178a7b455538daebd9 to your computer and use it in GitHub Desktop.
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: Elixir CI | |
on: | |
push: | |
tags: releases/* | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
db: | |
image: kartoza/postgis:12.1 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: sched_test | |
ports: ["5432:5432"] | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Checkout Dashboard | |
uses: actions/checkout@v2 | |
with: | |
repository: boulevard/Dashboard | |
path: Dashboard | |
ref: master | |
token: ${{secrets.DASHBOARD_PAT}} | |
- name: Setup elixir | |
uses: actions/setup-elixir@v1 | |
with: | |
elixir-version: 1.10.1 # Define the elixir version [required] | |
otp-version: 22.2 # Define the OTP version [required] | |
- uses: actions/cache@v1 | |
id: deps-cache | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
- uses: actions/cache@v1 | |
id: build-cache | |
with: | |
path: _build | |
key: ${{ runner.os }}-build-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
- uses: actions/cache@v1 | |
id: node-modules-cache | |
with: | |
path: Dashboard/node_modules | |
key: ${{ runner.os }}-build-${{ hashFiles(format('{0}{1}', github.workspace, '/Dashboard/package-lock.json')) }} | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
- name: npm install | |
run: npm install | |
working-directory: ./Dashboard | |
- name: Start front end server | |
run: yarn serve & | |
working-directory: ./Dashboard | |
- name: Install Dependencies | |
run: mix deps.get | |
- name: Check formatting | |
run: mix format --check-formatted | |
- name: npm install for assets | |
run: npm install | |
working-directory: ./assets | |
- run: npm run deploy --prefix ./assets | |
- name: Run Tests | |
run: mix test --exclude feature | |
- name: Run Feature Tests | |
run: mix test --only feature | |
- uses: actions/upload-artifact@v2 | |
if: ${{ failure() }} | |
with: | |
name: screenshots | |
path: screenshots/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment