Skip to content

Raindrops 48in24 approaches #814

Raindrops 48in24 approaches

Raindrops 48in24 approaches #814

Workflow file for this run

# This workflow will do a clean install of the dependencies and run tests across different versions
#
# Requires scripts:
# - bin/ci.sh
# - bin/ci-check.sh
name: elixir / main ci
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
jobs:
precheck:
runs-on: ubuntu-20.04
strategy:
matrix:
elixir: [1.16]
otp: [26.2]
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Use Elixir
uses: erlef/setup-beam@61e01a43a562a89bfc54c7f9a378ff67b03e4a21
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Set cache key
id: set_cache_key
run: |
erl -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), "OTP_VERSION"])), io:fwrite(Version), halt().' -noshell > ERLANG_VERSION
cat ERLANG_VERSION
elixir --version | tail -n 1 > ELIXIR_VERSION
cat ELIXIR_VERSION
cache_key="os-${{ runner.os }}-erlang-$( sha256sum ERLANG_VERSION | cut -d ' ' -f 1 )-elixir-$( sha256sum ELIXIR_VERSION | cut -d ' ' -f 1 )-mix-lock-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}"
echo "::set-output name=cache_key::$cache_key"
- name: Retrieve Mix Dependencies Cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
id: mix-cache # id to use in retrieve action
with:
path: deps
key: mix-${{ steps.set_cache_key.outputs.cache_key }}-v1
- name: Install Mix Dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: mix deps.get
- name: Build Project
run: mix
- name: Retrieve PLT Cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
id: plt-cache
with:
path: priv/plts
key: plts-${{ steps.set_cache_key.outputs.cache_key }}-v1
- name: Create PLTs
if: steps.plt-cache.outputs.cache-hit != 'true'
run: |
mkdir -p priv/plts
mix dialyzer --plt
- name: Run Prechecks
run: bin/ci-check.sh
ci:
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- elixir: '1.11.0'
otp: '23.2'
- elixir: '1.12.0'
otp: '24.0'
- elixir: '1.13.0'
otp: '24.1'
- elixir: '1.14.0'
otp: '25.0'
- elixir: '1.15.0'
otp: '26.0'
- elixir: '1.16.0'
otp: '26.2'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Use Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}
uses: erlef/setup-beam@61e01a43a562a89bfc54c7f9a378ff67b03e4a21
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Set cache key
id: set_cache_key
run: |
erl -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), "OTP_VERSION"])), io:fwrite(Version), halt().' -noshell > ERLANG_VERSION
cat ERLANG_VERSION
elixir --version | tail -n 1 > ELIXIR_VERSION
cat ELIXIR_VERSION
cache_key="os-${{ runner.os }}-erlang-$( sha256sum ERLANG_VERSION | cut -d ' ' -f 1 )-elixir-$( sha256sum ELIXIR_VERSION | cut -d ' ' -f 1 )-mix-lock-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}"
echo "::set-output name=cache_key::$cache_key"
- name: Retrieve Mix Dependencies Cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
id: mix-cache # id to use in retrieve action
with:
path: deps
key: mix-${{ steps.set_cache_key.outputs.cache_key }}-v1
- name: Install Mix Dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: mix deps.get
- name: Build Project
run: mix
- name: Run Checks
run: bin/ci.sh
linkChecker:
name: Link Checker
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Retrieve Lychee Cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
id: lychee-cache # id to use in retrieve action
with:
path: .lycheecache
key: lychee-v1
- name: Link Checker
uses: lycheeverse/lychee-action@c3089c702fbb949e3f7a8122be0c33c017904f9b
with:
args: --cache --max-cache-age 7d --require-https --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36" --no-progress './**/*.md' './**/*.html' './**/*.json'
fail: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}