attempt CI

This commit is contained in:
Mayel de Borniol 2024-04-15 21:53:01 +01:00
parent d8b880d7dc
commit c97a0056c5
9 changed files with 157 additions and 160 deletions

View file

@ -8,7 +8,7 @@ jobs:
docs:
name: Generate docs (upon new release)
runs-on: ubuntu-latest
container: hexpm/elixir:1.16.2-erlang-26.2.2-alpine-3.19.1
container: hexpm/elixir:1.16.2-erlang-26.2.4-alpine-3.19.1
env:
FLAVOUR: cooperation
FLAVOUR_PATH: flavours/cooperation
@ -62,4 +62,13 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/exdoc
cname: doc.bonfirenetworks.org
# - name: Create tags in extensions repos
# uses: bonfire-networks/create-tags-multirepo@v0.6
# with:
# version: ${{ steps.version.outputs.current-version }}
# message: ${{ github.event.inputs.message }}
# token: ${{ secrets.GH_TOKEN }}
# owner: "bonfire-networks"
# repos: "bonfire_api_graphql,bonfire_data_identity,bonfire_fail,bonfire_ui_me,bonfire_boundaries,bonfire_data_shared_user,bonfire_federate_activitypub,bonfire_quantify,bonfire_breadpub,bonfire_data_social,bonfire_files,bonfire_recyclapp,bonfire_ui_social,bonfire_classify,bonfire_geolocate,bonfire_search,bonfire_ui_valueflows,bonfire_common,bonfire_ecto,bonfire_invite_links,bonfire_social,bonfire_data_access_control,bonfire_editor_ck,bonfire_livebook,bonfire_tag,bonfire_valueflows,bonfire_data_activity_pub,bonfire_editor_quill,bonfire_mailer,bonfire_valueflows_api_schema,bonfire_data_assort,bonfire_me,bonfire_ui_common,bonfire_valueflows_observe,bonfire_epics,bonfire_notify,bonfire_ui_coordination,bonfire_data_edges,bonfire_extension_template,bonfire_open_id,bonfire_ui_kanban"
# # bonfire_upcycle,bonfire_publisher_thesis,bonfire_ui_reflow,bonfire_data_tasks,bonfire_taxonomy_seeder,bonfire_encryption_backend,bonfire_pages,bonfire_web_phoenix,bonfire_website

View file

@ -20,7 +20,7 @@ jobs:
FLAVOUR: ${{ matrix.flavour }}
DOCKER_REPO: bonfire
ALPINE_VERSION: 3.19.1
ERLANG_VERSION: 26.2.2
ERLANG_VERSION: 26.2.4
ELIXIR_VERSION: 1.16.2
steps:
-
@ -96,13 +96,14 @@ jobs:
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
# elixir_release:
# name: ${{ matrix.flavour }} - OTP on amd64 bullseye
# elixir_release_simple:
# name: ${{ matrix.flavour }} - OTP on amd64 bullseye # i.e. what's required by Yunohost
# strategy:
# matrix:
# flavour: ["classic"] # , "cooperation"]
# runs-on: ubuntu-latest
# container: debian:bullseye-slim
# container: debian:bullseye
# # container: debian:bullseye-slim
# env:
# FLAVOUR: ${{ matrix.flavour }}
# WITH_DOCKER: no
@ -121,13 +122,13 @@ jobs:
# fetch-depth: 2 # needed for action-detect-and-tag-new-version
# - name: Trust my repo
# run: export GIT_CEILING_DIRECTORIES=/__w && git config --global --add safe.directory $(realpath .) # see https://github.com/actions/checkout/issues/760
# -
# name: Maybe tag/release new version
# id: version
# uses: salsify/action-detect-and-tag-new-version@v2
# with:
# create-tag: false # unless tag is already created in another job
# version-command: grep -m 1 'version:' mix.exs | cut -d '"' -f2
# # -
# # name: Maybe tag/release new version
# # id: version
# # uses: salsify/action-detect-and-tag-new-version@v2
# # with:
# # create-tag: false # unless tag is already created in another job
# # version-command: grep -m 1 'version:' mix.exs | cut -d '"' -f2
# -
# if: steps.version.outputs.current-version == steps.version.outputs.previous-version
# name: Cancel workflow if the version has not changed
@ -136,9 +137,7 @@ jobs:
# name: Install deps & build app
# run: |
# chmod +x deps-debian.sh && ./deps-debian.sh
# . /opt/asdf/asdf.sh
# mix local.hex --force
# mix local.rebar --force
# # . /opt/asdf/asdf.sh
# just config
# just mix "deps.get --only prod"
# just rel-build
@ -155,150 +154,134 @@ jobs:
# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# # RELEASE_PATH: _build/prod/rel
# # CI: 1
# - name: Create tags in extensions repos
# uses: bonfire-networks/create-tags-multirepo@v0.6
# with:
# version: ${{ steps.version.outputs.current-version }}
# message: ${{ github.event.inputs.message }}
# token: ${{ secrets.GH_TOKEN }}
# owner: "bonfire-networks"
# repos: "bonfire_api_graphql,bonfire_data_identity,bonfire_fail,bonfire_ui_me,bonfire_boundaries,bonfire_data_shared_user,bonfire_federate_activitypub,bonfire_quantify,bonfire_breadpub,bonfire_data_social,bonfire_files,bonfire_recyclapp,bonfire_ui_social,bonfire_classify,bonfire_geolocate,bonfire_search,bonfire_ui_valueflows,bonfire_common,bonfire_ecto,bonfire_invite_links,bonfire_social,bonfire_data_access_control,bonfire_editor_ck,bonfire_livebook,bonfire_tag,bonfire_valueflows,bonfire_data_activity_pub,bonfire_editor_quill,bonfire_mailer,bonfire_valueflows_api_schema,bonfire_data_assort,bonfire_me,bonfire_ui_common,bonfire_valueflows_observe,bonfire_epics,bonfire_notify,bonfire_ui_coordination,bonfire_data_edges,bonfire_extension_template,bonfire_open_id,bonfire_ui_kanban"
# # bonfire_upcycle,bonfire_publisher_thesis,bonfire_ui_reflow,bonfire_data_tasks,bonfire_taxonomy_seeder,bonfire_encryption_backend,bonfire_pages,bonfire_web_phoenix,bonfire_website
# elixir_release_extra_architectures:
# # The host should always be linux
# runs-on: ubuntu-latest
# name: ${{ matrix.flavour }} - OTP on ${{ matrix.arch }} ${{ matrix.distro }}
# # Run steps on a matrix of several arch/distro combinations
# strategy:
# matrix:
# flavour: ["classic"] # , "cooperation"]
# arch: ["aarch64", "armv7"]
# distro: ["bullseye"]
# include:
# - arch: aarch64
# family: debian
# distro: bullseye
# # base_image: elixir:1.14-slim
# - arch: armv7
# family: debian
# distro: bullseye
# # base_image: elixir:1.14-slim
# # - arch: aarch64
# # distro: alpine_latest
# # - arch: none
# # distro: none
# # base_image: debian:bullseye-slim # Error: run-on-arch: If arch and distro are not specified, base_image is required
# # family: debian
# # arch_alt: amd64
# # distro_alt: bullseye
# env:
# FLAVOUR: ${{ matrix.flavour }}
# WITH_DOCKER: no
# MIX_ENV: prod
# TERM: linux
# steps:
# -
# name: Checkout
# uses: actions/checkout@v2
# with:
# fetch-depth: 2 # needed for action-detect-and-tag-new-version
# -
# name: Detect version
# id: version
# uses: salsify/action-detect-and-tag-new-version@v2
# with:
# create-tag: false # tag already created in other job
# version-command: |
# grep -m 1 'version:' mix.exs | cut -d '"' -f2
# - uses: uraimo/run-on-arch-action@v2.5.0
# name: Build artifact
# id: build
# with:
# arch: ${{ matrix.arch }}
# distro: ${{ matrix.distro }}
elixir_release_matrix:
# The host should always be linux
runs-on: ubuntu-latest
name: ${{ matrix.flavour }} - OTP on ${{ matrix.arch }} ${{ matrix.distro }}
# Run steps on a matrix of several arch/distro combinations
strategy:
matrix:
flavour: ["classic"] # , "cooperation"]
arch: ["amd64"] # "amd64", "aarch64", "armv7"]
distro: ["bullseye"]
include:
- arch: amd64
family: debian
distro: bullseye
# base_image: hexpm/elixir:1.16.2-erlang-26.2.4-debian-bullseye-20240408 # use bare debian so we build with same versions as in Yunohost recipe
# - arch: aarch64
# family: debian
# distro: bullseye
# - arch: armv7
# family: debian
# distro: bullseye
# # base_image: elixir:1.14-slim
# - arch: aarch64
# distro: alpine_latest
# - arch: none
# distro: none
# base_image: debian:bullseye-slim # Error: run-on-arch: If arch and distro are not specified, base_image is required
# family: debian
# arch_alt: amd64
# distro_alt: bullseye
env:
FLAVOUR: ${{ matrix.flavour }}
WITH_DOCKER: no
MIX_ENV: prod
TERM: linux
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2 # needed for action-detect-and-tag-new-version
-
name: Detect version
id: version
uses: salsify/action-detect-and-tag-new-version@v2
with:
create-tag: false # tag already created in other job
version-command: |
grep -m 1 'version:' mix.exs | cut -d '"' -f2
-
if: steps.version.outputs.current-version == steps.version.outputs.previous-version
name: Cancel workflow if the version has not changed
uses: andymckay/cancel-action@0.2
- uses: uraimo/run-on-arch-action@v2.7.2
name: Build artifact
id: build
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
# # Not required, but speeds up builds
# githubToken: ${{ github.token }}
# Not required, but speeds up builds
githubToken: ${{ github.token }}
# # Create an artifacts directory
# setup: |
# mkdir -p "${PWD}/artifacts"
# # cp .tool-versions "${PWD}/artifacts/"
# Create an artifacts directory
setup: |
echo "Setup!..."
mkdir -p "${PWD}/artifacts"
# cp .tool-versions "${PWD}/artifacts/"
# # Mount the artifacts directory as /artifacts in the container
# dockerRunArgs: |
# --volume "${PWD}/artifacts:/artifacts"
# Mount the artifacts directory as /artifacts in the container
dockerRunArgs: |
--volume "${PWD}/artifacts:/artifacts"
# # Pass some environment variables to the container
# env: | # YAML, but pipe character is necessary
# artifact_name: bonfire-${{ env.FLAVOUR }}-${{ matrix.arch || matrix.arch_alt }}-${{ matrix.family }}-${{ matrix.distro || matrix.distro_alt }}.tar.gz
# Pass some environment variables to the container
env: | # YAML, but pipe character is necessary
artifact_name: bonfire-${{ env.FLAVOUR }}-${{ matrix.arch || matrix.arch_alt }}-${{ matrix.family }}-${{ matrix.distro || matrix.distro_alt }}.tar.gz
# # The shell to run commands with in the container
# shell: /bin/bash
# The shell to run commands with in the container
shell: /bin/bash
# # Install some dependencies in the container. This speeds up builds if
# # you are also using githubToken. Any dependencies installed here will
# # be part of the container image that gets cached, so subsequent
# # builds don't have to re-install them. The image layer is cached
# # publicly in your project's package repository, so it is vital that
# # no secrets are present in the container state or logs.
# install: |
# export TERM=${{ env.TERM }}
# case "${{ matrix.distro }}" in
# ubuntu*|jessie|stretch|buster|bullseye)
# # chmod +x deps-debian.sh && ./deps-debian.sh
# # have to copy paste because the script ^ is not available in container:
# asdf_dir=/opt/asdf
# mkdir -p $asdf_dir
# apt-get update -q -y
# apt-get install -q -y --no-install-recommends git tar file gcc sqlite3 npm mailcap ca-certificates libssl-dev tzdata gettext curl rustc cargo wget gnupg sudo unzip
# git clone https://github.com/asdf-vm/asdf.git $asdf_dir --branch v0.11.1
# . "$asdf_dir/asdf.sh"
# asdf plugin-add erlang && asdf plugin-add elixir && asdf plugin-add just
# # Install
# apt-get install -q -y --no-install-recommends autoconf dpkg-dev gcc g++ make libncurses-dev unixodbc-dev libssl-dev libsctp-dev libodbc1 libssl1.1 libsctp1
# # TODO: use .tool-versions instead of latest
# which erl || (asdf install erlang latest && asdf global erlang latest)
# elixir -v || (asdf install elixir latest && asdf global elixir latest) #|| apt-get install -y elixir
# just --version || (asdf install just latest && asdf global just latest) || cargo install just #|| apt-get install -y just
# npm install --global yarn
# echo $PATH
# ls -la $asdf_dir && ls -la $asdf_dir/bin && /github/home/.asdf/shims
# elixir -v
# just --version
# yarn -v
# ;;
# alpine*)
# chmod +x deps-alpine.sh && ./deps-alpine.sh
# ;;
# esac
# mix local.hex --force
# mix local.rebar --force
# Install some dependencies in the container. This speeds up builds if
# you are also using githubToken. Any dependencies installed here will
# be part of the container image that gets cached, so subsequent
# builds don't have to re-install them. The image layer is cached
# publicly in your project's package repository, so it is vital that
# no secrets are present in the container state or logs.
install: |
echo "Install!..."
export TERM=${{ env.TERM }}
case "${{ matrix.distro }}" in
ubuntu*|jessie|stretch|buster|bullseye)
# chmod +x deps-debian.sh && ./deps-debian.sh
# TODO ^ how to use the script here? (checked out files not available in install step)
;;
alpine*)
# chmod +x deps-alpine.sh && ./deps-alpine.sh
;;
esac
# # Produce a binary artifact and place it in the mounted volume
# run: |
# . "/opt/asdf/asdf.sh"
# just config
# just mix "deps.get --only prod"
# just rel-build
# cd _build/prod/rel && tar -czvf /artifacts/${artifact_name} bonfire
# echo "Produced artifact at /artifacts/${artifact_name}"
# Produce a binary artifact and place it in the mounted volume
run: |
echo "Run!..."
case "${{ matrix.distro }}" in
ubuntu*|jessie|stretch|buster|bullseye)
chmod +x deps-debian.sh && ./deps-debian.sh
# TODO ^ do in install step instead
;;
alpine*)
chmod +x deps-alpine.sh && ./deps-alpine.sh
;;
esac
# . "/opt/asdf/asdf.sh"
just config
just mix "deps.get --only prod"
just rel-build
cd _build/prod/rel && tar -czvf /artifacts/${artifact_name} bonfire
echo "Produced artifact at /artifacts/${artifact_name}"
# - name: List the artifacts
# # Items placed in /artifacts in the container will be in
# # ${PWD}/artifacts on the host.
# run: |
# ls -al "${PWD}/artifacts"
# - name: Release to github
# uses: softprops/action-gh-release@v1
# with:
# files: "${PWD}/artifacts/*"
# name: Unstable - ${{ steps.version.outputs.tag }}
# tag_name: ${{ steps.version.outputs.tag }}
- name: List the artifacts
# Items placed in /artifacts in the container will be in
# ${PWD}/artifacts on the host.
run: |
ls -al "${PWD}/artifacts"
- name: Release to github
uses: softprops/action-gh-release@v1
with:
files: "${PWD}/artifacts/*"
name: Unstable - ${{ steps.version.outputs.tag }}
tag_name: ${{ steps.version.outputs.tag }}

View file

@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
flavour: ['classic'] # 'community', 'cooperation'
otp: ['26.2.2', '25.2.3']
otp: ['26.2.4', '25.2.3']
elixir: ['1.16.2'] # '1.14.5'
# ^ test with latest versions + oldest supported (i.e. versions available in debian stable)
env:

View file

@ -11,7 +11,7 @@ jobs:
test_classic_flavour:
name: Test classic flavour
runs-on: ubuntu-latest
container: hexpm/elixir:1.16.2-erlang-26.2.2-alpine-3.19.1
container: hexpm/elixir:1.16.2-erlang-26.2.4-alpine-3.19.1
env:
FLAVOUR: classic
MIX_ENV: test

View file

@ -1,6 +1,6 @@
# You can use asdf or [mise](https://github.com/jdx/mise) to install these
# NOTE: see upgrade instructions in .tool-versions.env
erlang 26.2.2
erlang 26.2.4
elixir 1.16.2-otp-26
# erlang 25.3.2.8
# elixir 1.13.4-otp-25

View file

@ -1 +1,4 @@
apk add bash git tar file build-base gcc sqlite npm mailcap ca-certificates openssl-dev tzdata gettext curl rust cargo just libc-dev elixir
mix local.hex --force
mix local.rebar --force

View file

@ -25,3 +25,5 @@ elixir -v
just --version
yarn -v
mix local.hex --force
mix local.rebar --force

View file

@ -154,7 +154,7 @@ defmodule Bonfire.Umbrella.MixProject do
# TODO: put these in ENV or an external writeable config file similar to deps.*
@config [
# note that the flavour will automatically be added where the dash appears
version: "0.9.10-beta.36",
version: "0.9.10-beta.37",
elixir: ">= #{System.get_env("ELIXIR_VERSION", "1.13.4")}",
flavour: @flavour,
default_flavour: @default_flavour,

View file

@ -31,11 +31,11 @@
"bonfire_boundaries": {:git, "https://github.com/bonfire-networks/bonfire_boundaries", "ce2be9b35140ebb58f099a33a61f8725d7bdc055", []},
"bonfire_breadpub": {:git, "https://github.com/bonfire-networks/bonfire_breadpub", "fefec42495858c15d7e033bb8979e8f4996af00c", []},
"bonfire_classify": {:git, "https://github.com/bonfire-networks/bonfire_classify", "2be51c3f3ae9e4c1225d4c472af9fb2c71e6095a", []},
"bonfire_common": {:git, "https://github.com/bonfire-networks/bonfire_common", "42e9ab75f5036648add4d87d6673d8c21b78247b", []},
"bonfire_common": {:git, "https://github.com/bonfire-networks/bonfire_common", "784e11e429684fc74c492aa0cbfab48594c4c28d", []},
"bonfire_data_access_control": {:git, "https://github.com/bonfire-networks/bonfire_data_access_control", "b7c3cd9886a22e0b3652baa7edd079fac29bdea3", []},
"bonfire_data_activity_pub": {:git, "https://github.com/bonfire-networks/bonfire_data_activity_pub", "00712af676e70f0f126861446bf873054f6e26c3", []},
"bonfire_data_assort": {:git, "https://github.com/bonfire-networks/bonfire_data_assort", "af26dd234af89e540ccdbb144fcb240e80a81563", []},
"bonfire_data_edges": {:git, "https://github.com/bonfire-networks/bonfire_data_edges", "35486587339da0f61abd1f63905ba467e04d2232", []},
"bonfire_data_edges": {:git, "https://github.com/bonfire-networks/bonfire_data_edges", "d7397b096035b5102eaf3158a134e655fe129021", []},
"bonfire_data_identity": {:git, "https://github.com/bonfire-networks/bonfire_data_identity", "d53f60b49a79e352d77edfb8852f9abfb6f01f7b", []},
"bonfire_data_shared_user": {:git, "https://github.com/bonfire-networks/bonfire_data_shared_user", "59c4c6da424a0071b462020ebd36c6778c695324", [branch: "main"]},
"bonfire_data_social": {:git, "https://github.com/bonfire-networks/bonfire_data_social", "19dab1cdf0c2d0c3e48e532d2d15c051bdef2bc8", []},
@ -44,7 +44,7 @@
"bonfire_epics": {:git, "https://github.com/bonfire-networks/bonfire_epics", "8d5506a49b91f4ba311b6684772e3ba30b7717af", []},
"bonfire_fail": {:git, "https://github.com/bonfire-networks/bonfire_fail", "b993bc2888e42a0bc4e6e6d30f4141e7a610738c", []},
"bonfire_federate_activitypub": {:git, "https://github.com/bonfire-networks/bonfire_federate_activitypub", "b6d7e7ef72f28fa83e58a329df3f4d993493f1df", []},
"bonfire_files": {:git, "https://github.com/bonfire-networks/bonfire_files", "ba87c6e88fc5eb8eb7fcc66457160f8d7c22139b", []},
"bonfire_files": {:git, "https://github.com/bonfire-networks/bonfire_files", "05de925365d86c8731e3f133e2f09fcc4ac64187", []},
"bonfire_geolocate": {:git, "https://github.com/bonfire-networks/bonfire_geolocate", "3649a59b3475b8acccfbf677bf4a9b564d822d67", []},
"bonfire_invite_links": {:git, "https://github.com/bonfire-networks/bonfire_invite_links", "3c0d0b3c0d1919fb1a899274ad64e30df8551446", []},
"bonfire_label": {:git, "https://github.com/bonfire-networks/bonfire_label", "fea824b03c7132a563ff7d8f3c3ed32170f68e5e", [branch: "main"]},