Repository navigation
Merge pull request #98 from jaeyson/97-resolve-decimal-version-to-use-v3 #11
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: CI v30.1 | |
| on: | |
| pull_request: | |
| branches: ["main"] | |
| push: | |
| branches: ["main"] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs | |
| # Workflows that would otherwise be triggered using `on: push` or | |
| # `on: pull_request` won't be triggered if you add any of the | |
| # following strings to the commit message in a push, or the HEAD | |
| # commit of a pull request: | |
| # - [skip ci] | |
| # - [ci skip] | |
| # - [no ci] | |
| # - [skip actions] | |
| # - [actions skip] | |
| test: | |
| runs-on: ubuntu-latest | |
| environment: review | |
| env: | |
| MIX_ENV: test | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| LATEST_TYPESENSE: '30.1' | |
| strategy: | |
| matrix: | |
| include: | |
| - typesense: '30.1' | |
| otp: '25' | |
| elixir: '1.15' | |
| lint: false | |
| - typesense: '30.1' | |
| otp: '27' | |
| elixir: '1.18' | |
| lint: false | |
| - typesense: '30.1' | |
| otp: '28' | |
| elixir: '1.19' | |
| lint: true | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - name: Check for misspellings | |
| uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579 | |
| - name: Start Typesense | |
| run: | | |
| docker run -id \ | |
| -p 8108:8108 \ | |
| --name typesense \ | |
| -v /tmp/typesense-data:/data \ | |
| -v /tmp/typesense-analytics-data:/analytics-data \ | |
| typesense/typesense:${{ matrix.typesense}} \ | |
| --api-key=xyz \ | |
| --data-dir=/data \ | |
| --enable-search-analytics=true \ | |
| --analytics-dir=/analytics-data \ | |
| --analytics-flush-interval=60 \ | |
| --analytics-minute-rate-limit=100 \ | |
| --enable-cors | |
| - name: Wait for Typesense to be healthy | |
| shell: bash | |
| run: | | |
| start_time=$(date +%s) | |
| timeout=30 | |
| counter=0 | |
| until curl -s http://localhost:8108/health | grep -q '"ok":true'; do | |
| if [ $counter -eq $timeout ]; then | |
| echo "Timed out waiting for Typesense to be healthy" | |
| exit 1 | |
| fi | |
| echo "Waiting for Typesense to be healthy..." | |
| sleep 1 | |
| counter=$((counter + 1)) | |
| done | |
| end_time=$(date +%s) | |
| elapsed=$((end_time - start_time)) | |
| echo "Typesense healthcheck elapsed: ${elapsed}s" | |
| - name: Setup Elixir/OTP | |
| uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93 | |
| with: | |
| otp-version: ${{matrix.otp}} | |
| elixir-version: ${{matrix.elixir}} | |
| - name: Cache dependencies/builds | |
| uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| priv/plts | |
| typesense-data | |
| key: ${{ runner.os }}-typesense-${{ matrix.typesense}}-${{ matrix.otp}}-${{ matrix.elixir}}-mix-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-typesense-${{ matrix.typesense}}-${{ matrix.otp }}-${{ matrix.elixir }}-mix- | |
| - name: Install Dependencies | |
| run: | | |
| mix local.rebar --if-missing | |
| mix local.hex --if-missing | |
| mix deps.get | |
| - name: Compile project | |
| run: mix compile --all-warnings | |
| - name: Find unused dependencies | |
| run: mix deps.unlock --check-unused | |
| if: ${{ matrix.lint }} | |
| - name: Check retired dependencies | |
| run: mix hex.audit | |
| if: ${{ matrix.lint }} | |
| - name: Security audit of dependencies | |
| run: mix deps.audit | |
| if: ${{ matrix.lint }} | |
| - name: Run static analysis | |
| run: mix credo --all --strict | |
| if: ${{ matrix.lint }} | |
| - name: Check format files | |
| run: mix format --check-formatted | |
| if: ${{ matrix.lint }} | |
| - name: Create PLTs | |
| if: ${{ steps.cache_restore.outputs.cache-hit != 'true' && matrix.lint }} | |
| run: mix dialyzer --plt | |
| - name: Dialyzer | |
| run: mix dialyzer --format github --format dialyxir | |
| if: ${{ matrix.lint }} | |
| - name: Post test coverage to Coveralls | |
| run: mix coveralls.github --only ${{ matrix.typesense }}:true --only nls:true --trace | |
| if: ${{ matrix.lint && github.event_name == 'push' && github.ref == 'refs/heads/main' }} |