Move provider into elixir common #25
This file contains hidden or 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: "vbt_new" | |
on: push | |
jobs: | |
vbt_new_build: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:11.7 | |
env: | |
POSTGRES_USER: "postgres" | |
POSTGRES_PASSWORD: "postgres" | |
POSTGRES_DB: "vbt_test" | |
ports: | |
- 5432:5432 | |
# needed because the postgres container does not provide a healthcheck | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
env: | |
CACHE_VERSION: v11 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: 24.0 | |
elixir-version: 1.12.2 | |
- name: Restore cached deps | |
uses: actions/cache@v4 | |
with: | |
path: vbt_new/deps | |
key: vbt_new_deps-${{ env.CACHE_VERSION }}-${{ github.ref }}-${{ hashFiles(format('{0}{1}', github.workspace, '/vbt_new/mix.lock')) }} | |
restore-keys: | | |
vbt_new_deps-${{ env.CACHE_VERSION }}-${{ github.ref }}- | |
vbt_new_deps-${{ env.CACHE_VERSION }}- | |
- name: Restore cached build | |
uses: actions/cache@v4 | |
with: | |
path: vbt_new/_build | |
key: vbt_new_build-${{ env.CACHE_VERSION }}-${{ github.ref }}-${{ hashFiles(format('{0}{1}', github.workspace, '/vbt_new/mix.lock')) }} | |
restore-keys: | | |
vbt_new_build-${{ env.CACHE_VERSION }}-${{ github.ref }}- | |
vbt_new_build-${{ env.CACHE_VERSION }}- | |
- name: Restore cached tmp | |
uses: actions/cache@v4 | |
with: | |
path: vbt_new/tmp | |
key: vbt_new_tmp-${{ env.CACHE_VERSION }}-${{ github.ref }}-${{ hashFiles(format('{0}{1}', github.workspace, '/vbt_new/test_projects/expected_state/mix.lock')) }} | |
restore-keys: | | |
vbt_new_tmp-${{ env.CACHE_VERSION }}-${{ github.ref }}- | |
vbt_new_tmp-${{ env.CACHE_VERSION }}- | |
- name: Fetch deps | |
run: cd vbt_new && mix deps.get | |
- name: Compile project | |
run: | | |
cd vbt_new | |
MIX_ENV=test mix compile --warnings-as-errors | |
MIX_ENV=dev mix compile --warnings-as-errors | |
MIX_ENV=prod mix compile --warnings-as-errors | |
- name: Check code format | |
run: cd vbt_new && mix format --check-formatted | |
- name: Run linter checks | |
run: cd vbt_new && mix credo list | |
- name: Run tests | |
run: cd vbt_new && mix test | |
- name: Run dialyzer | |
run: cd vbt_new && mix dialyzer | |
- name: Build archive | |
run: cd vbt_new && mix archive.build | |
#- name: Configure AWS Credentials | |
# uses: aws-actions/configure-aws-credentials@v1 | |
# with: | |
# aws-access-key-id: AKIA5B73P2OV7SEEGVWQ | |
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
# aws-region: us-east-1 | |
#- name: Deploy archive | |
# if: github.ref == 'refs/heads/master' | |
# run: aws s3 cp --acl public-read --region us-east-1 ./vbt_new/vbt_new-0.1.0.ez s3://vbt-common-docs.verybigthings.com/vbt_new.ez |