Adds durations and date arithmetic #98
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| paths-ignore: | |
| - 'README.md' | |
| - 'CHANGELOG.md' | |
| - 'LICENSE' | |
| - 'docs/**' | |
| - '*.md' | |
| pull_request: | |
| branches: [ main, master ] | |
| paths-ignore: | |
| - 'README.md' | |
| - 'CHANGELOG.md' | |
| - 'LICENSE' | |
| - 'docs/**' | |
| - '*.md' | |
| env: | |
| MIX_ENV: test | |
| jobs: | |
| compile: | |
| name: Compile | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| elixir: ['1.17', '1.18'] | |
| otp: ['26', '27'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{ matrix.elixir }} | |
| otp-version: ${{ matrix.otp }} | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Compile with warnings as errors | |
| run: mix compile --warnings-as-errors | |
| format: | |
| name: Code Formatting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: '1.17' | |
| otp-version: '27' | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: deps-${{ runner.os }}-27-1.17-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| deps-${{ runner.os }}-27-1.17- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Check formatting | |
| run: mix format --check-formatted | |
| test: | |
| name: Test & Coverage | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| elixir: ['1.17', '1.18'] | |
| otp: ['26', '27'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{ matrix.elixir }} | |
| otp-version: ${{ matrix.otp }} | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Run tests with coverage | |
| run: mix coveralls.json | |
| - name: Upload coverage reports to Codecov | |
| if: matrix.elixir == '1.18' && matrix.otp == '27' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| slug: riddler/predicator-ex | |
| files: ./cover/excoveralls.json | |
| credo: | |
| name: Static Analysis (Credo) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: '1.17' | |
| otp-version: '27' | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: deps-${{ runner.os }}-27-1.17-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| deps-${{ runner.os }}-27-1.17- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Run Credo | |
| run: mix credo --strict | |
| dialyzer: | |
| name: Static Type Analysis (Dialyzer) | |
| runs-on: ubuntu-latest | |
| needs: compile | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: '1.18.3' | |
| otp-version: '27.3' | |
| - name: Cache deps | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: deps-${{ runner.os }}-27.3-1.18.3-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| deps-${{ runner.os }}-27.3-1.18.3- | |
| - name: Cache Dialyzer PLTs | |
| uses: actions/cache@v4 | |
| with: | |
| path: priv/plts | |
| key: dialyzer-${{ runner.os }}-27.3-1.18.3-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| dialyzer-${{ runner.os }}-27.3-1.18.3- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Compile dependencies | |
| run: mix deps.compile | |
| - name: Compile project | |
| run: mix compile | |
| - name: Run Dialyzer | |
| run: mix dialyzer | |
| quality: | |
| name: Quality Gate | |
| runs-on: ubuntu-latest | |
| needs: [compile, format, test, credo, dialyzer] | |
| steps: | |
| - name: All checks passed | |
| run: echo "All quality checks have passed successfully!" |