Update alpine Docker tag to v3.22.2 (#118) #307
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: Elixir CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
services: | |
postgres: | |
image: postgres:18.0 | |
env: | |
POSTGRES_USER: almazilaletdinov | |
POSTGRES_DB: croniq_db | |
POSTGRES_PASSWORD: | |
POSTGRES_HOST_AUTH_METHOD: trust | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
redis: | |
image: redis:8 | |
ports: | |
- 6379:6379 | |
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 | |
name: Build and test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@566deebc640988a494af16ecdf6f820fe0d3fea4 | |
with: | |
elixir-version: '1.18' | |
otp-version: '26' | |
# - name: Set up db | |
# run: psql -d revive_bot -U almazilaletdinov -h localhost < .github/setup-db.sql | |
# - name: Set up .env | |
# run: cp .github/workflows/.env .env | |
- name: Restore dependencies cache | |
uses: actions/cache@v4 | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-mix- | |
- name: Install dependencies | |
run: mix deps.get | |
- name: Build | |
run: mix compile --warnings-as-errors | |
- name: Run tests | |
run: mix test | |
lint: | |
name: Lint code | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@566deebc640988a494af16ecdf6f820fe0d3fea4 | |
with: | |
elixir-version: '1.18' | |
otp-version: '26' | |
- name: Restore dependencies cache | |
uses: actions/cache@v4 | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-mix- | |
- name: Install dependencies | |
run: mix deps.get | |
- name: Check format | |
run: mix format --check-formatted | |
- name: Run credo | |
run: mix credo --strict | |
- name: Checking files for compliance with editorconfig | |
run: | | |
VERSION="v3.1.2" | |
curl -O -L -C - https://github.com/editorconfig-checker/editorconfig-checker/releases/download/$VERSION/ec-linux-amd64.tar.gz | |
mkdir ec | |
tar -xzf ec-linux-amd64.tar.gz -C ec | |
git ls-files | xargs ec/bin/ec-linux-amd64 -v |