Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
CI: use hex.pm images and refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
fhunleth committed Mar 14, 2021
1 parent 5f85745 commit ef45f10
Showing 1 changed file with 34 additions and 26 deletions.
60 changes: 34 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,67 @@
version: 2

defaults: &defaults
working_directory: ~/repo
docker:
- image: nervesproject/nerves_system_br:latest
environment:
ENV: CI
MIX_ENV: test
ELIXIR_VERSION: 1.11.2-otp-23
LC_ALL: C.UTF-8

install_elixir: &install_elixir
run:
name: Install Elixir
command: |
wget https://repo.hex.pm/builds/elixir/v$ELIXIR_VERSION.zip
unzip -d /usr/local/elixir v$ELIXIR_VERSION.zip
echo 'export PATH=/usr/local/elixir/bin:$PATH' >> $BASH_ENV
install_hex_rebar: &install_hex_rebar
run:
name: Install hex and rebar
command: |
mix local.hex --force
mix local.rebar --force
install_nerves_bootstrap: &install_nerves_bootstrap
install_system_deps: &install_system_deps
run:
name: Install nerves_bootstrap
name: Install system dependencies
command: |
mix archive.install hex nerves_bootstrap "~> 1.0" --force
version: 2
apk add build-base
apk add fwup --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community
jobs:
build:
build_elixir_1_11_otp_23:
docker:
- image: hexpm/elixir:1.11.3-erlang-23.2.2-alpine-3.12.1
<<: *defaults
steps:
- checkout
- <<: *install_elixir
- <<: *install_hex_rebar
- <<: *install_nerves_bootstrap
- <<: *install_system_deps
- restore_cache:
keys:
- v1-mix-cache-{{ checksum "mix.lock" }}
- run: mix deps.get
- run: mix format --check-formatted
# SUDO=true -> disable autodetection of a host build and the "helpful"
# call to sudo
- run: SUDO=true mix compile
- run: mix test
- run: mix format --check-formatted
- run: mix hex.build
- run: SUDO=true mix compile --warnings-as-errors
- run: mix docs
- run: mix dialyzer --halt-exit-status
- run: mix hex.build
- run: mix test
- run: mix dialyzer
- save_cache:
key: v1-mix-cache-{{ checksum "mix.lock" }}
paths:
- _build
- deps

build_elixir_1_10_otp_23:
docker:
- image: hexpm/elixir:1.10.4-erlang-23.1.2-alpine-3.12.1
<<: *defaults
steps:
- checkout
- <<: *install_hex_rebar
- <<: *install_system_deps
- run: mix deps.get
- run: SUDO=true mix compile
- run: mix test

workflows:
version: 2
build_test:
jobs:
- build_elixir_1_11_otp_23
- build_elixir_1_10_otp_23

0 comments on commit ef45f10

Please sign in to comment.