diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml deleted file mode 100644 index c79ac2613..000000000 --- a/.semaphore/semaphore.yml +++ /dev/null @@ -1,194 +0,0 @@ -# DO NOT EDIT -# This is a generated file by the `script/generate_ci_matrix` task. -# See `.semaphore/semaphore.yml.erb` for the build matrix. -# Generate this file with `script/generate_ci_matrix`. -version: v1.0 -name: AppSignal Elixir Build and Tests -agent: - machine: - type: e1-standard-2 - os_image: ubuntu2004 -blocks: - - name: Run linters and tests - task: - prologue: - commands: - - checkout - jobs: - - name: Git Lint (Lintje) - commands: - - script/lint_git - - name: Validate CI matrix - commands: - - script/validate_ci_matrix - - name: mix compile --warnings-as-errors - commands: - - ERLANG_VERSION=26.0 ELIXIR_VERSION=1.15.0 . bin/setup - - mix compile --warnings-as-errors - - name: mix format --check-formatted - commands: - - ERLANG_VERSION=26.0 ELIXIR_VERSION=1.15.0 . bin/setup - - mix format --check-formatted - - name: mix credo --strict - commands: - - ERLANG_VERSION=26.0 ELIXIR_VERSION=1.15.0 . bin/setup - - mix credo --strict - - name: mix dialyzer - commands: - - ERLANG_VERSION=26.0 ELIXIR_VERSION=1.15.0 . bin/setup - - cache restore dialyzer-plt - - MIX_ENV=dev mix dialyzer --plt - - cache store dialyzer-plt priv/plts/ - - MIX_ENV=dev mix dialyzer --format dialyzer - - name: Elixir 1.15.0 OTP 26.0 - Diagnose tests - env_vars: - - name: LANGUAGE - value: elixir - - name: MIX_ENV - value: dev - commands: - - ERLANG_VERSION=26.0 ELIXIR_VERSION=1.15.0 . bin/setup - - git submodule init - - git submodule update - - test/integration/diagnose/bin/test - - name: Elixir 1.15.0, OTP 26.0, without the NIF loaded - env_vars: - - name: MIX_ENV - value: test_no_nif - commands: - - ERLANG_VERSION=26.0 ELIXIR_VERSION=1.15.0 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir main, OTP 26.0 - commands: - - ERLANG_VERSION=26.0 ELIXIR_VERSION=main . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.15.0, OTP 26.0 - commands: - - ERLANG_VERSION=26.0 ELIXIR_VERSION=1.15.0 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.14.5, OTP 26.0 - commands: - - ERLANG_VERSION=26.0 ELIXIR_VERSION=1.14.5 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir main, OTP 25.3 - commands: - - ERLANG_VERSION=25.3 ELIXIR_VERSION=main . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.15.0, OTP 25.3 - commands: - - ERLANG_VERSION=25.3 ELIXIR_VERSION=1.15.0 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.14.5, OTP 25.3 - commands: - - ERLANG_VERSION=25.3 ELIXIR_VERSION=1.14.5 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.13.4, OTP 25.3 - commands: - - ERLANG_VERSION=25.3 ELIXIR_VERSION=1.13.4 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.15.0, OTP 24.3 - commands: - - ERLANG_VERSION=24.3 ELIXIR_VERSION=1.15.0 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.14.5, OTP 24.3 - commands: - - ERLANG_VERSION=24.3 ELIXIR_VERSION=1.14.5 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.13.4, OTP 24.3 - commands: - - ERLANG_VERSION=24.3 ELIXIR_VERSION=1.13.4 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.12.3, OTP 24.3 - commands: - - ERLANG_VERSION=24.3 ELIXIR_VERSION=1.12.3 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.11.4, OTP 24.3 - commands: - - ERLANG_VERSION=24.3 ELIXIR_VERSION=1.11.4 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.14.5, OTP 23.3 - commands: - - ERLANG_VERSION=23.3 ELIXIR_VERSION=1.14.5 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.13.4, OTP 23.3 - commands: - - ERLANG_VERSION=23.3 ELIXIR_VERSION=1.13.4 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.12.3, OTP 23.3 - commands: - - ERLANG_VERSION=23.3 ELIXIR_VERSION=1.12.3 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.11.4, OTP 23.3 - commands: - - ERLANG_VERSION=23.3 ELIXIR_VERSION=1.11.4 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.10.4, OTP 23.3 - commands: - - ERLANG_VERSION=23.3 ELIXIR_VERSION=1.10.4 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.13.4, OTP 22.3 - commands: - - ERLANG_VERSION=22.3 ELIXIR_VERSION=1.13.4 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.12.3, OTP 22.3 - commands: - - ERLANG_VERSION=22.3 ELIXIR_VERSION=1.12.3 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.11.4, OTP 22.3 - commands: - - ERLANG_VERSION=22.3 ELIXIR_VERSION=1.11.4 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.10.4, OTP 22.3 - commands: - - ERLANG_VERSION=22.3 ELIXIR_VERSION=1.10.4 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.9.4, OTP 22.3 - commands: - - ERLANG_VERSION=22.3 ELIXIR_VERSION=1.9.4 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.11.4, OTP 21.3 - commands: - - ERLANG_VERSION=21.3 ELIXIR_VERSION=1.11.4 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.10.4, OTP 21.3 - commands: - - ERLANG_VERSION=21.3 ELIXIR_VERSION=1.10.4 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.9.4, OTP 21.3 - commands: - - ERLANG_VERSION=21.3 ELIXIR_VERSION=1.9.4 . bin/setup - - mix compile - - mix test --no-compile - - name: Elixir 1.9.4, OTP 20.3 - commands: - - ERLANG_VERSION=20.3 ELIXIR_VERSION=1.9.4 . bin/setup - - mix compile - - mix test --no-compile - env_vars: - - name: MIX_ENV - value: test diff --git a/.semaphore/semaphore.yml.erb b/.semaphore/semaphore.yml.erb deleted file mode 100644 index 171224ff3..000000000 --- a/.semaphore/semaphore.yml.erb +++ /dev/null @@ -1,78 +0,0 @@ -<% -require_relative "versions" -NEWEST_OTP = VERSIONS.keys.first -NEWEST_ELIXIR = VERSIONS[NEWEST_OTP][:elixir][1] --%> -# DO NOT EDIT -# This is a generated file by the `script/generate_ci_matrix` task. -# See `.semaphore/semaphore.yml.erb` for the build matrix. -# Generate this file with `script/generate_ci_matrix`. -version: v1.0 -name: AppSignal Elixir Build and Tests -agent: - machine: - type: e1-standard-2 - os_image: ubuntu2004 -blocks: - - name: Run linters and tests - task: - prologue: - commands: - - checkout - jobs: - - name: Git Lint (Lintje) - commands: - - script/lint_git - - name: Validate CI matrix - commands: - - script/validate_ci_matrix - - name: mix compile --warnings-as-errors - commands: - - ERLANG_VERSION=<%= NEWEST_OTP %> ELIXIR_VERSION=<%= NEWEST_ELIXIR %> . bin/setup - - mix compile --warnings-as-errors - - name: mix format --check-formatted - commands: - - ERLANG_VERSION=<%= NEWEST_OTP %> ELIXIR_VERSION=<%= NEWEST_ELIXIR %> . bin/setup - - mix format --check-formatted - - name: mix credo --strict - commands: - - ERLANG_VERSION=<%= NEWEST_OTP %> ELIXIR_VERSION=<%= NEWEST_ELIXIR %> . bin/setup - - mix credo --strict - - name: mix dialyzer - commands: - - ERLANG_VERSION=<%= NEWEST_OTP %> ELIXIR_VERSION=<%= NEWEST_ELIXIR %> . bin/setup - - cache restore dialyzer-plt - - MIX_ENV=dev mix dialyzer --plt - - cache store dialyzer-plt priv/plts/ - - MIX_ENV=dev mix dialyzer --format dialyzer - - name: Elixir <%= NEWEST_ELIXIR %> OTP <%= NEWEST_OTP %> - Diagnose tests - env_vars: - - name: LANGUAGE - value: elixir - - name: MIX_ENV - value: dev - commands: - - ERLANG_VERSION=<%= NEWEST_OTP %> ELIXIR_VERSION=<%= NEWEST_ELIXIR %> . bin/setup - - git submodule init - - git submodule update - - test/integration/diagnose/bin/test - - name: Elixir <%= NEWEST_ELIXIR %>, OTP <%= NEWEST_OTP %>, without the NIF loaded - env_vars: - - name: MIX_ENV - value: test_no_nif - commands: - - ERLANG_VERSION=<%= NEWEST_OTP %> ELIXIR_VERSION=<%= NEWEST_ELIXIR %> . bin/setup - - mix compile - - mix test --no-compile -<% VERSIONS.each do |otp_version, versions| -%> -<% versions[:elixir].each do |elixir_version| -%> - - name: Elixir <%= elixir_version %>, OTP <%= otp_version %> - commands: - - ERLANG_VERSION=<%= otp_version %> ELIXIR_VERSION=<%= elixir_version %> . bin/setup - - mix compile - - mix test --no-compile -<% end -%> -<% end -%> - env_vars: - - name: MIX_ENV - value: test diff --git a/.semaphore/versions.rb b/.semaphore/versions.rb deleted file mode 100644 index 87d1eed32..000000000 --- a/.semaphore/versions.rb +++ /dev/null @@ -1,9 +0,0 @@ -VERSIONS = { - "26.0" => {elixir: ["main", "1.15.0", "1.14.5"], phoenix: ["~> 1.7.0"]}, - "25.3" => {elixir: ["main", "1.15.0", "1.14.5", "1.13.4"], phoenix: ["~> 1.7.0"]}, - "24.3" => {elixir: ["1.15.0", "1.14.5", "1.13.4", "1.12.3", "1.11.4"], phoenix: ["~> 1.7.0"]}, - "23.3" => {elixir: ["1.14.5", "1.13.4", "1.12.3", "1.11.4", "1.10.4"], phoenix: ["~> 1.6.0"]}, - "22.3" => {elixir: ["1.13.4", "1.12.3", "1.11.4", "1.10.4", "1.9.4"], phoenix: ["~> 1.6.0"]}, - "21.3" => {elixir: ["1.11.4", "1.10.4", "1.9.4"], phoenix: ["~> 1.6.0"]}, - "20.3" => {elixir: ["1.9.4"], phoenix: ["~> 1.6.0"]} -} diff --git a/bin/setup b/bin/setup deleted file mode 100755 index 1b31de71c..000000000 --- a/bin/setup +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -set -e - -elixirs_key="elixir-$ELIXIR_VERSION-erlang-$ERLANG_VERSION-elixirs" -archives_key="elixir-$ELIXIR_VERSION-erlang-$ERLANG_VERSION-archives" - -elixirs_path=~/".kiex/elixirs" -archives_path=~/".kiex/mix/archives" - -rm -rf "$elixirs_path"/* -rm -rf "$archives_path"/* - -EXPECTED_ERLANG_VERSION="26.0" -if [[ "$ERLANG_VERSION" == "$EXPECTED_ERLANG_VERSION" && $(cache has_key "v2-erlang-$ERLANG_VERSION") ]]; then - cache restore "v2-erlang-$ERLANG_VERSION" -fi -sem-version erlang "$ERLANG_VERSION" -if [ "$ERLANG_VERSION" == "$EXPECTED_ERLANG_VERSION" ]; then - cache store "v2-erlang-$ERLANG_VERSION" /home/semaphore/.kerl -fi -erl -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), "OTP_VERSION"])), io:fwrite(Version), halt().' -noshell - -if [ $ELIXIR_VERSION != "main" ] && \ - cache has_key "$elixirs_key" && \ - cache has_key "$archives_key" -then - cache restore "$elixirs_key" - cache restore "$archives_key" -else - kiex install $ELIXIR_VERSION - cache store "$elixirs_key" "$elixirs_path" - cache store "$archives_key" "$archives_path" -fi - -kiex use $ELIXIR_VERSION -elixir -v - -mix local.rebar -mix local.hex --force -mix deps.get - -# Unset exit on error so the shell is usable after running this script -set +e diff --git a/script/generate_ci_matrix b/script/generate_ci_matrix deleted file mode 100755 index e039a0e76..000000000 --- a/script/generate_ci_matrix +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -set -eu - -erb -T- .semaphore/semaphore.yml.erb > .semaphore/semaphore.yml diff --git a/script/lint_git b/script/lint_git deleted file mode 100755 index 325a51563..000000000 --- a/script/lint_git +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -set -eu - -LINTJE_VERSION="0.6.1" - -mkdir -p $HOME/bin -cache_key=v1-lintje-$LINTJE_VERSION -cache restore $cache_key - -# File exists and is executable -if [ -x "$HOME/bin/lintje" ]; then - echo "Restored Lintje $LINTJE_VERSION from cache" -else - echo "Downloading Lintje $LINTJE_VERSION" - curl -L \ - https://github.com/tombruijn/lintje/releases/download/v$LINTJE_VERSION/x86_64-unknown-linux-gnu.tar.gz | \ - tar -xz --directory $HOME/bin - cache store $cache_key $HOME/bin/lintje -fi - -$HOME/bin/lintje $SEMAPHORE_GIT_COMMIT_RANGE diff --git a/script/setup b/script/setup deleted file mode 100644 index f8545c2df..000000000 --- a/script/setup +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -set -eu - -# Change version number to a release/tag available on the mono repo to update it -# https://github.com/appsignal/mono/releases -MONO_VERSION="v0.6.0" - -MONO_PATH="$HOME/mono" - -has_cache=false -if which cache >/dev/null; then - has_cache=true -fi - -if $has_cache; then - echo "Restoring mono cache" - cache restore mono-$MONO_VERSION -fi - -# Download mono if the cache restored nothing -if [ ! -d $MONO_PATH ]; then - mkdir -p $MONO_PATH - curl --location https://github.com/appsignal/mono/archive/refs/tags/$MONO_VERSION.tar.gz | \ - tar -xz --strip-components=1 --directory $MONO_PATH - if $has_cache; then - echo "Storing mono cache" - cache store mono-$MONO_VERSION $MONO_PATH - fi -fi - -cd $MONO_PATH -# Install mono always as it adds itself to the PATH -script/setup diff --git a/script/validate_ci_matrix b/script/validate_ci_matrix deleted file mode 100755 index bf1b89ea7..000000000 --- a/script/validate_ci_matrix +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -eu - -if ! git diff --exit-code .semaphore/semaphore.yml; then - echo - echo "Error: There's a mismatch between the semaphore.yml and semaphore.yml.erb file." - exit 1 -fi