[DOCS] Add hex.pm, docs, CI, and coverage badges #49
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] | |
| pull_request: | |
| branches: [main, master] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| MIX_ENV: test | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Nix | |
| uses: cachix/install-nix-action@v27 | |
| with: | |
| nix_path: nixpkgs=channel:nixos-unstable | |
| - name: Setup Nix cache | |
| uses: DeterminateSystems/magic-nix-cache-action@v7 | |
| - name: Cache Mix dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mix- | |
| - name: Cache Dialyzer PLT | |
| uses: actions/cache@v4 | |
| with: | |
| path: priv/plts | |
| key: ${{ runner.os }}-plt-${{ hashFiles('**/mix.lock') }}-${{ hashFiles('**/*.ex') }} | |
| restore-keys: | | |
| ${{ runner.os }}-plt-${{ hashFiles('**/mix.lock') }}- | |
| ${{ runner.os }}-plt- | |
| - name: Install dependencies | |
| run: nix develop --command mix deps.get | |
| - name: Run linters | |
| run: nix develop --command mix lint | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Nix | |
| uses: cachix/install-nix-action@v27 | |
| with: | |
| nix_path: nixpkgs=channel:nixos-unstable | |
| - name: Setup Nix cache | |
| uses: DeterminateSystems/magic-nix-cache-action@v7 | |
| - name: Cache Mix dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mix- | |
| - name: Install dependencies | |
| run: nix develop --command mix deps.get | |
| - name: Run tests | |
| run: nix develop --command mix test | |
| - name: Generate coverage report | |
| continue-on-error: true | |
| run: nix develop --command mix coveralls.github | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| e2e: | |
| name: E2E Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Nix | |
| uses: cachix/install-nix-action@v27 | |
| with: | |
| nix_path: nixpkgs=channel:nixos-unstable | |
| - name: Setup Nix cache | |
| uses: DeterminateSystems/magic-nix-cache-action@v7 | |
| - name: Run E2E tests | |
| run: nix develop --command bash e2e/run_tests.sh | |
| timeout-minutes: 10 | |
| - name: Show logs on failure | |
| if: failure() | |
| run: | | |
| cd e2e | |
| docker compose logs --tail=100 || docker-compose logs --tail=100 || true |