This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
34 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
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 | ||
|