WIP Twitter #75
Workflow file for this run
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: CI | |
on: | |
# This action is triggered on any branch that opens a pull request. | |
push: | |
branches: | |
- "*" | |
# This action is not triggered when markdown files are modified. | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
branches: | |
- "*" | |
# This action is not triggered when markdown files are modified. | |
paths-ignore: | |
- '**.md' | |
env: | |
# Permissions env | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# General env | |
ELIXIR_VERSION: 1.14 | |
OTP_VERSION: 25.2 | |
# Postgres env | |
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} | |
POSTGRES_USER: ${{ secrets.POSTGRES_USER }} | |
POSTGRES_HOSTNAME: localhost | |
# Redis env | |
REDIS_HOST: localhost | |
REDIS_PORT: 6379 | |
REDIS_PASS: '123456' | |
# Misc env | |
UPLOADS_PATH: "priv/static/uploads/" | |
FINNHUB_API_KEY: ${{ secrets.FINNHUB_API_KEY }} | |
CAFECITO_USERNAME: ${{ secrets.CAFECITO_USERNAME }} | |
jobs: | |
dev: | |
runs-on: ubuntu-22.04 | |
services: | |
db: | |
image: postgres | |
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: | |
# Setup & run Redis ----------------------------------------------------- | |
- name: Run redis with a password | |
shell: bash | |
run: | | |
docker run \ | |
--rm \ | |
--name redis \ | |
-p ${{ env.REDIS_PORT }}:6379 \ | |
-d redis:6-alpine redis-server \ | |
--appendonly yes \ | |
--requirepass ${{ env.REDIS_PASS }} \ | |
--port ${{ env.REDIS_PORT }} | |
# Run the dev action ---------------------------------------------------- | |
- uses: actions/checkout@v2.3.4 | |
- name: Run Development Checks | |
uses: ./.github/actions/dev | |
with: | |
CURRENCY_SUPPLIER: currency-supplier | |
CURRENCY_SUPPLIER_PRODUCER_NAME: CurrencySupplierProducer | |
CEDEAR_SUPPLIER: cedear-supplier | |
CEDEAR_SUPPLIER_PRODUCER_NAME: CedearSupplierProducer | |
ELIXIR_VERSION: ${{ env.ELIXIR_VERSION }} | |
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
MIX_ENV: dev | |
OTP_VERSION: ${{ env.OTP_VERSION }} | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_USER: postgres | |
REDIS_HOST: ${{ env.REDIS_HOST }} | |
REDIS_PASS: ${{ env.REDIS_PASS }} | |
UPLOADS_PATH: ${{ env.UPLOADS_PATH }} | |
FINNHUB_API_KEY: ${{ env.FINNHUB_API_KEY }} | |
CAFECITO_USERNAME: ${{ env.CAFECITO_USERNAME }} | |
test: | |
runs-on: ubuntu-22.04 | |
services: | |
db: | |
image: postgres | |
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: | |
# Setup & run Redis ----------------------------------------------------- | |
- name: Run redis with a password | |
shell: bash | |
run: | | |
docker run \ | |
--rm \ | |
--name redis \ | |
-p ${{ env.REDIS_PORT }}:6379 \ | |
-d redis:6-alpine redis-server \ | |
--appendonly yes \ | |
--requirepass ${{ env.REDIS_PASS }} \ | |
--port ${{ env.REDIS_PORT }} | |
# Run the test action --------------------------------------------------- | |
- uses: actions/checkout@v2.3.4 | |
- name: Run Unit Tests | |
uses: ./.github/actions/test | |
with: | |
CURRENCY_SUPPLIER: currency-supplier | |
CURRENCY_SUPPLIER_PRODUCER_NAME: CurrencySupplierProducer | |
CEDEAR_SUPPLIER: cedear-supplier | |
CEDEAR_SUPPLIER_PRODUCER_NAME: CedearSupplierProducer | |
ELIXIR_VERSION: ${{ env.ELIXIR_VERSION }} | |
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
MIX_ENV: test | |
OTP_VERSION: ${{ env.OTP_VERSION }} | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_USER: postgres | |
REDIS_HOST: ${{ env.REDIS_HOST }} | |
REDIS_PASS: ${{ env.REDIS_PASS }} | |
UPLOADS_PATH: ${{ env.UPLOADS_PATH }} | |
FINNHUB_API_KEY: ${{ env.FINNHUB_API_KEY }} | |
CAFECITO_USERNAME: ${{ env.CAFECITO_USERNAME }} | |
prod: | |
runs-on: ubuntu-22.04 | |
services: | |
db: | |
image: postgres | |
ports: ['5432:5432'] | |
env: | |
POSTGRES_USER: ${{ env.POSTGRES_USER }} | |
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v2.3.4 | |
- name: Assemble release | |
uses: ./.github/actions/prod | |
with: | |
ELIXIR_VERSION: ${{ env.ELIXIR_VERSION }} | |
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
MIX_ENV: prod | |
OTP_VERSION: ${{ env.OTP_VERSION }} | |
POSTGRES_HOSTNAME: ${{ env.POSTGRES_HOSTNAME }} | |
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} | |
POSTGRES_USER: ${{ env.POSTGRES_USER }} | |
REDIS_HOST: ${{ env.REDIS_HOST }} | |
REDIS_PASS: ${{ env.REDIS_PASS }} | |
UPLOADS_PATH: ${{ env.UPLOADS_PATH }} | |
FINNHUB_API_KEY: ${{ env.FINNHUB_API_KEY }} | |
CAFECITO_USERNAME: ${{ env.CAFECITO_USERNAME }} |