Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test
Expand All @@ -25,47 +29,53 @@ jobs:
with:
path: deps
key: ${{ runner.os }}-mix-deps-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-deps-

- name: Restore build cache
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
with:
path: _build
key: ${{ runner.os }}-mix-build-${{ hashFiles('flake.lock', 'mix.lock') }}
key: ${{ runner.os }}-mix-build-${{ hashFiles('flake.nix', 'flake.lock') }}-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-build-${{ hashFiles('flake.nix', 'flake.lock') }}-

- name: Restore PLT cache
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5
with:
path: priv/plts
key: ${{ runner.os }}-plt-${{ hashFiles('flake.lock', 'mix.lock') }}
key: ${{ runner.os }}-plt-${{ hashFiles('flake.nix', 'flake.lock') }}-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-plt-${{ hashFiles('flake.nix', 'flake.lock') }}-

- name: Install dependencies
run: nix develop --command mix deps.get --check-locked
run: nix develop .#ci --command mix deps.get --check-locked

- name: Compile
run: nix develop --command mix compile --warnings-as-errors
run: nix develop .#ci --command mix compile --warnings-as-errors

- name: Check formatting
run: nix develop --command mix format --check-formatted
run: nix develop .#ci --command mix format --check-formatted

- name: Check unused dependencies
run: nix develop --command mix deps.unlock --check-unused
run: nix develop .#ci --command mix deps.unlock --check-unused

- name: Check dependency cycles
run: nix develop --command mix xref graph --format cycles --fail-above 0
run: nix develop .#ci --command mix xref graph --format cycles --fail-above 0

- name: Run unit tests without soffice
run: nix develop --command mix test --exclude integration
run: nix develop .#ci --command mix test --exclude integration
env:
URP_INTEGRATION: "0"

- name: Build documentation
run: nix develop --command mix docs --warnings-as-errors
run: nix develop .#ci --command mix docs --warnings-as-errors

- name: Audit Hex dependencies
run: nix develop --command mix hex.audit
run: nix develop .#ci --command mix hex.audit

- name: Run dialyzer
run: nix develop --command mix dialyzer
run: nix develop .#ci --command mix dialyzer

- uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4

Expand All @@ -88,6 +98,6 @@ jobs:
timeout 30 bash -c 'until nc -z localhost 2002; do sleep 1; done'

- name: Run integration tests
run: nix develop --command mix test --include integration --include lo26
run: nix develop .#ci --command mix test --include integration --include lo26
env:
URP_INTEGRATION: "1"
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,21 @@ jobs:
with:
path: deps
key: ${{ runner.os }}-mix-deps-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-deps-

- name: Install dependencies
run: nix develop --command mix deps.get --check-locked
run: nix develop .#ci --command mix deps.get --check-locked

- name: Verify tag, package version, and changelog
run: |
version="$(tr -d '[:space:]' < VERSION)"
test "${GITHUB_REF_NAME}" = "v${version}"
grep --fixed-strings --quiet "## [v${version}]" CHANGELOG.md
nix develop --command mix hex.build
nix develop .#ci --command mix hex.build

- name: Publish to Hex
run: nix develop --command mix hex.publish --yes
run: nix develop .#ci --command mix hex.publish --yes
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}

Expand Down
11 changes: 11 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
let
pkgs = nixpkgs.legacyPackages.${system};
beamPackages = pkgs.beam.packages.erlang_29;
# CI/release tasks are headless; avoid the full wx and systemd closure.
ciBeamPackages = pkgs.beamMinimal29Packages;
in
{
default = pkgs.mkShell {
Expand All @@ -24,6 +26,15 @@
pkgs.uv
];
};

ci = pkgs.mkShell {
packages = [
ciBeamPackages.erlang
ciBeamPackages.elixir_1_20
ciBeamPackages.hex
ciBeamPackages.rebar3
];
};
}
);
};
Expand Down