populate tasks from json files #1098
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: Build PR | |
on: | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
# Use test environment by default | |
env: | |
MIX_ENV: test | |
POSTGRES_PASSWORD: postgres | |
services: | |
db: | |
image: postgres:16-alpine | |
ports: ["5432:5432"] | |
env: | |
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
--name=pg_ci | |
--mount type=tmpfs,destination=/var/lib/postgresql/data | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
otp-version: "27.2" | |
elixir-version: "1.18.2" | |
- name: Cache Dependencies | |
uses: actions/cache@v4 | |
id: deps-cache | |
with: | |
path: | | |
./services/app/deps | |
./services/app/_build | |
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | |
restore-keys: | | |
${{ runner.os }}-mix- | |
- name: Get deps | |
if: steps.deps-cache.outputs.cache-hit != 'true' | |
run: mix deps.get | |
working-directory: ./services/app | |
- name: Mix deps.compile | |
run: mix compile --warnings-as-errors | |
working-directory: ./services/app | |
- name: Mix format | |
run: mix format --check-formatted | |
working-directory: ./services/app | |
- name: Mix credo | |
run: mix credo --strict | |
working-directory: ./services/app | |
- name: Get yarn cache | |
id: yarn-cache | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install yarn dependencies | |
run: yarn install --frozen-lockfile | |
working-directory: ./services/app/apps/codebattle | |
- name: Eslint | |
run: yarn lint | |
working-directory: ./services/app/apps/codebattle | |
- name: Run jest | |
run: yarn test | |
working-directory: ./services/app/apps/codebattle | |
- name: Setup db | |
run: | | |
mix ecto.create | |
mix ecto.migrate | |
working-directory: ./services/app | |
- name: Mix tests | |
run: make test | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./services/app/assp/codebattle/cover/excoveralls.json | |
fail_ci_if_error: false |