From d34eb21b26991ecff09e4f9cedf21703d44f05e0 Mon Sep 17 00:00:00 2001 From: Giacomo Leidi Date: Fri, 18 Oct 2024 18:41:17 +0200 Subject: [PATCH] Add CI --- .github/workflows/main.yml | 60 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..74fbd12 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,60 @@ +name: Main branch + +on: + push: + branches: + - "main" + pull_request: + branches: + - "*" + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +env: + MIX_ENV: test + +permissions: + contents: read + +jobs: + test: + name: Build and test + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + elixir-version: ['1.17.3'] + otp-version: ['27.1', '25.2.3'] + mix-env: ['prod', 'test'] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Elixir + uses: erlef/setup-beam@v1 + with: + elixir-version: ${{ matrix.elixir-version }} # [Required] Define the Elixir version + otp-version: ${{ matrix.otp-version }} # [Required] Define the Erlang/OTP version + + - name: Restore dependencies cache + uses: actions/cache@v3 + with: + path: deps + key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} + restore-keys: ${{ runner.os }}-mix- + + - name: Setup just + run: sudo snap install --edge just --classic + shell: bash + + - name: Get dependencies + run: | + export MIX_ENV=${{ matrix.mix-env }} + mix deps.get + shell: bash + + - name: Compile package + run: | + export MIX_ENV=${{ matrix.mix-env }} + mix compile + shell: bash