From 7aba64a07d684d3ae529cfad9993f2127cc6f6c9 Mon Sep 17 00:00:00 2001 From: Benjamin Schultzer Date: Sun, 21 Apr 2024 15:57:13 -0400 Subject: [PATCH] Add integration test --- .github/workflows/integration.yml | 127 ++++++++++++++++++++++++++++++ mix.exs | 2 +- 2 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/integration.yml diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 000000000..780256b8c --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,127 @@ +name: Integration +on: push +env: + MIX_ENV: test + CLDR_PATH: ${{github.workspace}}/${{github.ref_name}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}} +permissions: + contents: read +jobs: + min: + services: + db: + image: postgres:12 + ports: ['5432:5432'] + env: + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + continue-on-error: true + strategy: + fail-fast: false + matrix: + app: ["cldr_calendars", "cldr_calendars_composite", "cldr_calendars_coptic", + "cldr_calendars_ethiopic", "cldr_calendars_format", + "cldr_calendars_japanese", "cldr_calendars_lunisolar", + "cldr_calendars_persian", "cldr_collation", "cldr_currencies", + "cldr_dates_times", "cldr_html", "cldr_languages", "cldr_lists", + "cldr_locale_display", "cldr_messages", "cldr_numbers", + "cldr_person_names", "cldr_plugs", "cldr_print", "cldr_routes", + "cldr_sql", "cldr_strftime", "cldr_territories", "cldr_text", + "cldr_trans", "cldr_units", "cldr_units_sql", "cldr_utils"] + elixir: ["1.13"] + otp: ["25"] + runs-on: ubuntu-latest + name: ${{steps.setup-beam.outputs.elixir-version}}-otp-${{steps.setup-beam.outputs.otp-version}} ${{matrix.app}} + steps: + - name: Set up elixir ${{matrix.elixir}}-otp-${{matrix.otp}} + uses: erlef/setup-beam@v1 + with: + otp-version: ${{matrix.otp}} + elixir-version: ${{matrix.elixir}} + - name: Checkout ${{github.repository_owner}}/${{matrix.app}} + uses: actions/checkout@v4 + with: + path: ${{matrix.app}} + repository: ${{github.repository_owner}}/${{matrix.app}} + - name: Checkout ${{github.repository}} + uses: actions/checkout@v4 + with: + path: ${{github.ref_name}} + repository: ${{github.repository}} + ref: ${{github.ref_name}} + + - name: Built release + working-directory: ./${{github.workspace}}/${{github.ref_name}} + run: mix hex.build -o ${{env.CLDR_PATH}} --unpack + + - name: Setup and run tests + working-directory: ./${{github.workspace}}/${{matrix.app}} + run: | + mix deps.get + deps.compile + mix compile --warnings-as-errors + mix test + mix help | grep -E '(^| )dialyzer( |$)' && mix dialyzer + + latest: + services: + db: + image: postgres:12 + ports: ['5432:5432'] + env: + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + continue-on-error: true + strategy: + fail-fast: false + matrix: + app: ["cldr_calendars", "cldr_calendars_composite", "cldr_calendars_coptic", + "cldr_calendars_ethiopic", "cldr_calendars_format", + "cldr_calendars_japanese", "cldr_calendars_lunisolar", + "cldr_calendars_persian", "cldr_collation", "cldr_currencies", + "cldr_dates_times", "cldr_html", "cldr_languages", "cldr_lists", + "cldr_locale_display", "cldr_messages", "cldr_numbers", + "cldr_person_names", "cldr_plugs", "cldr_print", "cldr_routes", + "cldr_sql", "cldr_strftime", "cldr_territories", "cldr_text", + "cldr_trans", "cldr_units", "cldr_units_sql", "cldr_utils"] + elixir: ["latest"] + otp: ["latest"] + runs-on: ubuntu-latest + name: ${{steps.setup-beam.outputs.elixir-version}}-otp-${{steps.setup-beam.outputs.otp-version}} ${{matrix.app}} + steps: + - name: Set up elixir ${{matrix.elixir}}-otp-${{matrix.otp}} + uses: erlef/setup-beam@v1 + with: + otp-version: ${{matrix.otp}} + elixir-version: ${{matrix.elixir}} + - name: Checkout ${{github.repository_owner}}/${{matrix.app}} + uses: actions/checkout@v4 + with: + path: ${{matrix.app}} + repository: ${{github.repository_owner}}/${{matrix.app}} + - name: Checkout ${{github.repository}} + uses: actions/checkout@v4 + with: + path: ${{github.ref_name}} + repository: ${{github.repository}} + ref: ${{github.ref_name}} + + - name: Built release + working-directory: ./${{github.workspace}}/${{github.ref_name}} + run: mix hex.build -o ${{env.CLDR_PATH}} --unpack + + - name: Setup and run tests + working-directory: ./${{github.workspace}}/${{matrix.app}} + run: | + mix deps.get + deps.compile + mix compile --warnings-as-errors + mix test + mix help | grep -E '(^| )dialyzer( |$)' && mix dialyzer diff --git a/mix.exs b/mix.exs index bbe81ed39..6ca39c10d 100644 --- a/mix.exs +++ b/mix.exs @@ -7,7 +7,7 @@ defmodule Cldr.Mixfile do [ app: :ex_cldr, version: @version, - elixir: "~> 1.12", + elixir: "~> 1.13", name: "Cldr", source_url: "https://github.com/elixir-cldr/cldr", docs: docs(),