Skip to content

chore: remove external github action to install elixir #7

chore: remove external github action to install elixir

chore: remove external github action to install elixir #7

# Do not forget to change status badge in ./README.md
name: frontend_on_push_branch_execute_ci_cd
on:
push:
branches: [main]
# See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags
pull_request:
# Only branches and tags on the base are evaluated
branches: [main]
env:
NODE_VERSION: "18.12.1"
jobs:
build_deps:
runs-on: ubuntu-latest
# We stick to the elixir image in order to make sure the debian version and installed dependencies are the same:
container: hexpm/elixir:1.15.7-erlang-26.2.2-debian-bullseye-20240130-slim
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
- uses: actions/cache@v4
id: cache-npm
with:
path: npm-cache
key: ${{ runner.os }}-npm-v2-${{ hashFiles('**/frontend/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-v2
- run: npm --prefix frontend --cache npm-cache ci
if: steps.cache-npm.outputs.cache-hit != 'true'
frontend_check_npm_lint:
runs-on: ubuntu-latest
container: hexpm/elixir:1.15.7-erlang-26.2.2-debian-bullseye-20240130-slim
needs: build_deps
steps:
- name: Check out repository code
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
- uses: actions/cache@v4
id: cache-npm
with:
path: npm-cache
key: ${{ runner.os }}-npm-v1-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-npm-v1
- run: npm --prefix frontend run lint
frontend_check_npm_check_types:
runs-on: ubuntu-latest
container: hexpm/elixir:1.15.7-erlang-26.2.2-debian-bullseye-20240130-slim
needs: build_deps
steps:
- name: Check out repository code
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
- uses: actions/cache@v4
id: cache-npm
with:
path: npm-cache
key: ${{ runner.os }}-npm-v2-${{ hashFiles('**/frontend/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-v2
- run: npm --prefix frontend run check-types
frontend_check_npm_test:
runs-on: ubuntu-latest
container: hexpm/elixir:1.15.7-erlang-26.2.2-debian-bullseye-20240130-slim
needs: build_deps
steps:
- name: Check out repository code
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
- uses: actions/cache@v4
id: cache-npm
with:
path: npm-cache
key: ${{ runner.os }}-npm-v2-${{ hashFiles('**/frontend/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-v2
- run: npm --prefix frontend run test