Skip to content

add option to deactivate tagger, further added smaller optimizations … #35

add option to deactivate tagger, further added smaller optimizations …

add option to deactivate tagger, further added smaller optimizations … #35

Workflow file for this run

name: Docker Image CI
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
NODE_VERSION: "18.12.1"
OTP_VERSION: "26.2.1"
ELIXIR_VERSION: "1.15.7"
jobs:
build_deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install node and elixir
uses: ./.github/actions/setup-composite-action
with:
node-version: ${{env.NODE_VERSION}}
otp-version: ${{env.OTP_VERSION}}
elixir-version: ${{env.ELIXIR_VERSION}}
- uses: actions/cache@v3
id: cache-mix
with:
path: deps
key: ${{ runner.os }}-mix-v1-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-v1
- uses: actions/cache@v3
id: cache-npm
with:
path: frontend/node_modules
key: ${{ runner.os }}-npm-v1-${{ hashFiles('**/frontend/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-v1
wordcharts-frontend-lint:
runs-on: ubuntu-latest
needs: build_deps
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
id: cache-npm
with:
path: deps
key: ${{ runner.os }}-mix-v1-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-npm-v1
- uses: actions/setup-node@v3
with:
node-version: ${{env.NODE_VERSION}}
- run: npm --prefix frontend ci
- run: npm --prefix frontend run lint
wordcharts-frontend-check-types:
runs-on: ubuntu-latest
needs: build_deps
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
id: cache-npm
with:
path: deps
key: ${{ runner.os }}-mix-v1-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-npm-v1
- uses: actions/setup-node@v3
with:
node-version: ${{env.NODE_VERSION}}
- run: npm --prefix frontend ci
- run: npm --prefix frontend run check-types
wordcharts-frontend-test:
runs-on: ubuntu-latest
needs: build_deps
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
id: cache-npm
with:
path: deps
key: ${{ runner.os }}-mix-v1-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-npm-v1
- uses: actions/setup-node@v3
with:
node-version: ${{env.NODE_VERSION}}
- run: npm --prefix frontend ci
- run: npm --prefix frontend run test
wordcharts-backend-lint:
runs-on: ubuntu-latest
needs: build_deps
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
id: cache-mix
with:
path: deps
key: ${{ runner.os }}-mix-v1-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-v1
- uses: erlef/setup-beam@v1
with:
otp-version: ${{env.OTP_VERSION}}
elixir-version: ${{env.ELIXIR_VERSION}}
- run: mix format
# See https://docs.github.com/en/actions/using-containerized-services/creating-postgresql-service-containers
wordcharts-backend-test:
runs-on: ubuntu-latest
needs: build_deps
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
image: postgres:latest
env:
# These env variables are required by the postgres service (see above)
POSTGRES_DB: wordcharts_test
POSTGRES_HOST: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
# These env vars are required by our application
# Unfortunately, github workflow does not support yaml anchors ;-(
TEST_DATABASE_HOST: localhost
TEST_DATABASE_NAME: wordcharts_test
TEST_DATABASE_USER: postgres
TEST_DATABASE_USER_PASSWORD: postgres
MIX_ENV: "test"
steps:
# Downloads a copy of the code in your repository before running CI tests
- uses: actions/checkout@v3
- name: Install node and elixir
uses: ./.github/actions/setup-composite-action
with:
node-version: ${{env.NODE_VERSION}}
otp-version: ${{env.OTP_VERSION}}
elixir-version: ${{env.ELIXIR_VERSION}}
- uses: actions/cache@v3
id: cache-mix
with:
path: deps
key: ${{ runner.os }}-mix-v1-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-v1
- uses: actions/cache@v3
id: cache-npm
with:
path: frontend/node_modules
key: ${{ runner.os }}-npm-v1-${{ hashFiles('**/frontend/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-v1
# install hex:
- run: mix local.hex --force && mix local.rebar --force
- run: mix compile
- run: mix ecto.create
- run: mix ecto.migrate
- run: mix test