attempt to fix cors issues on UI #302
This file contains hidden or 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
| name: Elixir CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # | |
| # run test suite | |
| # | |
| test: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: server | |
| env: | |
| MIX_ENV: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: "1.18.3" | |
| otp-version: "OTP-27" | |
| - uses: foundry-rs/foundry-toolchain@v1 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| server/deps | |
| server/_build | |
| key: ${{ runner.os }}-mix-${{ hashFiles('server/mix.lock') }} | |
| restore-keys: ${{ runner.os }}-mix- | |
| # Cache key based on Erlang/Elixir version and the mix.lock hash | |
| - name: Restore PLT cache | |
| id: plt_cache | |
| uses: actions/cache/restore@v3 | |
| with: | |
| key: | | |
| plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}- | |
| path: | | |
| server/priv/plts | |
| - name: Install dependencies | |
| run: mix deps.get | |
| # Create PLTs if no cache was found | |
| - name: Create PLTs | |
| if: steps.plt_cache.outputs.cache-hit != 'true' | |
| run: mix dialyzer --plt | |
| # By default, the GitHub Cache action will only save the cache if all steps in the job succeed, | |
| # so we separate the cache restore and save steps in case running dialyzer fails. | |
| - name: Save PLT cache | |
| id: plt_cache_save | |
| uses: actions/cache/save@v3 | |
| if: steps.plt_cache.outputs.cache-hit != 'true' | |
| with: | |
| key: | | |
| plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }} | |
| path: | | |
| server/priv/plts | |
| - name: Compile | |
| run: mix compile | |
| - name: Create database | |
| run: mix ecto.create | |
| - name: Run migrations | |
| run: mix ecto.migrate | |
| - name: Run Credo | |
| run: mix credo | |
| - name: Run dialyzer | |
| run: mix dialyzer --format github --format dialyxir | |
| - name: Run tests | |
| run: mix test |