|
| 1 | +name: test |
| 2 | +on: push |
| 3 | +env: |
| 4 | + MIX_ENV: test |
| 5 | + CLDR_PATH: ${{github.workspace}}/${{github.ref_name}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}} |
| 6 | +permissions: |
| 7 | + contents: read |
| 8 | +jobs: |
| 9 | + min: |
| 10 | + services: |
| 11 | + db: |
| 12 | + image: postgres:12 |
| 13 | + ports: ['5432:5432'] |
| 14 | + env: |
| 15 | + POSTGRES_PASSWORD: postgres |
| 16 | + options: >- |
| 17 | + --health-cmd pg_isready |
| 18 | + --health-interval 10s |
| 19 | + --health-timeout 5s |
| 20 | + --health-retries 5 |
| 21 | + continue-on-error: true |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + matrix: |
| 25 | + app: ["cldr_calendars", "cldr_calendars_composite", "cldr_calendars_coptic", |
| 26 | + "cldr_calendars_ethiopic", "cldr_calendars_format", |
| 27 | + "cldr_calendars_japanese", "cldr_calendars_lunisolar", |
| 28 | + "cldr_calendars_persian", "cldr_collation", "cldr_currencies", |
| 29 | + "cldr_dates_times", "cldr_html", "cldr_languages", "cldr_lists", |
| 30 | + "cldr_locale_display", "cldr_messages", "cldr_numbers", |
| 31 | + "cldr_person_names", "cldr_plugs", "cldr_print", "cldr_routes", |
| 32 | + "cldr_sql", "cldr_strftime", "cldr_territories", "cldr_text", |
| 33 | + "cldr_trans", "cldr_units", "cldr_units_sql", "cldr_utils"] |
| 34 | + elixir: ["1.12"] |
| 35 | + otp: [">22"] |
| 36 | + runs-on: ubuntu-latest |
| 37 | + name: ${{matrix.elixir}}-otp-${{matrix.otp}} ${{matrix.app}} |
| 38 | + steps: |
| 39 | + - name: Set up elixir ${{matrix.elixir}}-otp-${{matrix.otp}} |
| 40 | + uses: erlef/setup-beam@v1 |
| 41 | + with: |
| 42 | + otp-version: ${{matrix.otp}} |
| 43 | + elixir-version: ${{matrix.elixir}} |
| 44 | + - name: Checkout ${{github.repository_owner}}/${{matrix.app}} |
| 45 | + uses: actions/checkout@v4 |
| 46 | + with: |
| 47 | + path: ${{matrix.app}} |
| 48 | + repository: ${{github.repository_owner}}/${{matrix.app}} |
| 49 | + - name: Checkout ${{github.repository}} |
| 50 | + uses: actions/checkout@v4 |
| 51 | + with: |
| 52 | + path: ${{github.ref_name}} |
| 53 | + repository: ${{github.repository}} |
| 54 | + ref: ${{github.ref_name}} |
| 55 | + |
| 56 | + - name: Built release |
| 57 | + run: cd ${{github.workspace}}/${{github.ref_name}} && mix hex.build -o ${{env.CLDR_PATH}} --unpack |
| 58 | + |
| 59 | + - name: Install dependencies |
| 60 | + run: cd ${{github.workspace}}/${{matrix.app}} && mix deps.get && mix deps.compile |
| 61 | + |
| 62 | + - name: Compiles without warnings |
| 63 | + run: cd ${{github.workspace}}/${{matrix.app}} && mix compile --warnings-as-errors |
| 64 | + |
| 65 | + # - name: Check Formatting |
| 66 | + # run: mix format --check-formatted |
| 67 | + |
| 68 | + - name: Run tests |
| 69 | + run: cd ${{github.workspace}}/${{matrix.app}} && mix test |
| 70 | + |
| 71 | + - name: Run dialyzer |
| 72 | + run: cd ${{github.workspace}}/${{matrix.app}} && mix dialyzer |
| 73 | + latest: |
| 74 | + services: |
| 75 | + db: |
| 76 | + image: postgres:12 |
| 77 | + ports: ['5432:5432'] |
| 78 | + env: |
| 79 | + POSTGRES_PASSWORD: postgres |
| 80 | + options: >- |
| 81 | + --health-cmd pg_isready |
| 82 | + --health-interval 10s |
| 83 | + --health-timeout 5s |
| 84 | + --health-retries 5 |
| 85 | + continue-on-error: true |
| 86 | + strategy: |
| 87 | + fail-fast: false |
| 88 | + matrix: |
| 89 | + app: ["cldr_calendars", "cldr_calendars_composite", "cldr_calendars_coptic", |
| 90 | + "cldr_calendars_ethiopic", "cldr_calendars_format", |
| 91 | + "cldr_calendars_japanese", "cldr_calendars_lunisolar", |
| 92 | + "cldr_calendars_persian", "cldr_collation", "cldr_currencies", |
| 93 | + "cldr_dates_times", "cldr_html", "cldr_languages", "cldr_lists", |
| 94 | + "cldr_locale_display", "cldr_messages", "cldr_numbers", |
| 95 | + "cldr_person_names", "cldr_plugs", "cldr_print", "cldr_routes", |
| 96 | + "cldr_sql", "cldr_strftime", "cldr_territories", "cldr_text", |
| 97 | + "cldr_trans", "cldr_units", "cldr_units_sql", "cldr_utils"] |
| 98 | + elixir: ["latest"] |
| 99 | + otp: ["latest"] |
| 100 | + runs-on: ubuntu-latest |
| 101 | + name: ${{matrix.elixir}}-otp-${{matrix.otp}} ${{matrix.app}} |
| 102 | + steps: |
| 103 | + - name: Set up elixir ${{matrix.elixir}}-otp-${{matrix.otp}} |
| 104 | + uses: erlef/setup-beam@v1 |
| 105 | + with: |
| 106 | + otp-version: ${{matrix.otp}} |
| 107 | + elixir-version: ${{matrix.elixir}} |
| 108 | + - name: Checkout ${{github.repository_owner}}/${{matrix.app}} |
| 109 | + uses: actions/checkout@v4 |
| 110 | + with: |
| 111 | + path: ${{matrix.app}} |
| 112 | + repository: ${{github.repository_owner}}/${{matrix.app}} |
| 113 | + - name: Checkout ${{github.repository}} |
| 114 | + uses: actions/checkout@v4 |
| 115 | + with: |
| 116 | + path: ${{github.ref_name}} |
| 117 | + repository: ${{github.repository}} |
| 118 | + ref: ${{github.ref_name}} |
| 119 | + |
| 120 | + - name: Built release |
| 121 | + run: cd ${{github.workspace}}/${{github.ref_name}} && mix hex.build -o ${{env.CLDR_PATH}} --unpack |
| 122 | + |
| 123 | + - name: Install dependencies |
| 124 | + run: cd ${{github.workspace}}/${{matrix.app}} && mix deps.get && mix deps.compile |
| 125 | + |
| 126 | + - name: Compiles without warnings |
| 127 | + run: cd ${{github.workspace}}/${{matrix.app}} && mix compile --warnings-as-errors |
| 128 | + |
| 129 | + # - name: Check Formatting |
| 130 | + # run: mix format --check-formatted |
| 131 | + |
| 132 | + - name: Run tests |
| 133 | + run: cd ${{github.workspace}}/${{matrix.app}} && mix test |
| 134 | + |
| 135 | + - name: Run dialyzer |
| 136 | + run: cd ${{github.workspace}}/${{matrix.app}} && mix dialyzer |
0 commit comments