diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index 2cc618c..5964a60 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -1,8 +1,3 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - name: Elixir CI on: @@ -16,9 +11,9 @@ permissions: jobs: build: - name: Build and test runs-on: ubuntu-latest + services: db: image: postgres:16 @@ -34,22 +29,43 @@ jobs: steps: - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install npm dependencies + run: npm ci + working-directory: assets # Muuta tämä tarvittaessa + - name: Set up Elixir uses: erlef/setup-beam@v1 with: - elixir-version: '1.17.2' # [Required] Define the Elixir version - otp-version: '26.0' # [Required] Define the Erlang/OTP version - - name: Restore depedencies cache - uses: actions/cache@v3 + elixir-version: '1.17.2' + otp-version: '26.0' + + - name: Restore dependencies cache + uses: actions/cache@v4 # Päivitetty v3:sta v4:ään with: path: deps key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} restore-keys: ${{ runner.os }}-mix- + - name: Install dependencies run: mix deps.get + + - name: Compile dependencies + run: mix deps.compile + - name: Run tests run: mix test + - name: Check Formatting run: mix format --check-formatted + - name: Run Credo run: mix credo --strict + + - name: Run Dialyzer + run: mix dialyzer