Skip to content

Commit

Permalink
💚 added ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jcaillon committed Jan 22, 2025
1 parent d1cdfb3 commit a0f362b
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 11 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/self-test-bash5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Self test

# Controls when the workflow will run
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Default to bash
defaults:
run:
shell: bash -o errexit -o nounset -o pipefail -x {0}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
self-test:
runs-on: ubuntu-latest
container: noyacode/minideb-bash5.0
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive

# Runs our tests
- name: Run valet self test
env:
VALET_CONFIG_ENABLE_COLORS: true
VALET_CONFIG_DISABLE_PROGRESS: true
run: |
chmod +x valet
./valet self test -C
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ ARG STANDARD_PACKAGES="curl ca-certificates locales"

# ✅ install packages
# ✅ set up locale
ARG LOCALE=en_US
ARG LOCALE=C
ENV LANG=${LOCALE}.UTF-8
ENV LC_ALL=${LOCALE}.UTF-8
ENV LANGUAGE=${LOCALE}.UTF-8
RUN \
install_packages ${STANDARD_PACKAGES} ; \
localedef -i ${LOCALE} -c -f UTF-8 -A /usr/share/locale/locale.alias ${LOCALE}.UTF-8; \
echo "LC_ALL=${LOCALE}.UTF-8" >> /etc/environment; \
echo "${LOCALE}.UTF-8 UTF-8" >> /etc/locale.gen; \
echo "LANG=${LOCALE}.UTF-8" >> /etc/locale.conf; \
locale-gen ${LOCALE}.UTF-8
Expand Down
3 changes: 2 additions & 1 deletion docs/content/docs/800.roadmap/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ url: /docs/roadmap

This page lists the features that I would like to implement in Valet. They come in addition to new features described in the [issues][valet-issues].

- refacto: move func from string/io lib to regex, path, fs libs. renamed fsfs to sfzf::show
- make `source` able to source multiple libraries that are called the same. Improve the function to quickly return for sourced lib (anything not starting with / or .)
- the config file should define everything, leave all def commented. When we self config we define only those already defined. We have an associative array of each var and description to handle this
- all interactive functions must write to stderr not stdout!
- add info of the extension from which a command comes from
Expand All @@ -31,7 +33,6 @@ This page lists the features that I would like to implement in Valet. They come
- Demo with ascii cinema: https://asciinema.org. Put the showcase in the index page instead.
- For all the optional arguments of exported functions, allow to set them using a global variable `_OPTION_*` in addition to the positional argument. Add this in the documentation about functions.
- allow an array for options `--file 1 --file 2` -> `files=(1 2)` `--file <files*>`
- make `source` able to source multiple libraries that are called the same.
- add-test
- for major version and breaking changes, we can add a lib `compat-x.x` which can be sourced by functions and declares functions as in version x.x.
- Filter build command for `commands.d` ?
Expand Down
3 changes: 3 additions & 0 deletions libraries.d/lib-command
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
# author: github.com/jcaillon
# description: This script can be sourced by commands to provide convenient functions.
8 changes: 4 additions & 4 deletions tests.d/lib-test/results.approved.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,11 @@ RETURNED_ARRAY2=(

You can manually report the definition of any variable using the `test::printVars` function.

`test::printVars GLOBAL_VAR1 GLOBAL_VAR2 GLOBAL_VAR3`
`test::printVars MY_VAR1 MY_VAR2 MY_VAR3`

```text
GLOBAL_VAR1='This is the value of a global string'
GLOBAL_VAR2=(
MY_VAR1='This is the value of a global string'
MY_VAR2=(
[0]='This'
[1]='is'
[2]='the'
Expand All @@ -253,7 +253,7 @@ GLOBAL_VAR2=(
[6]='global'
[7]='array'
)
GLOBAL_VAR3=(
MY_VAR3=(
[key2]='2'
[key3]='3'
[key1]='1'
Expand Down
1 change: 1 addition & 0 deletions tests.d/self-export/results.approved.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ source ansi-codes
source array
source bash
source benchmark
source command
source curl
source fsfs
source http
Expand Down
22 changes: 19 additions & 3 deletions tests.d/self-install/docker-valet-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
FROM ubuntu:latest
FROM bitnami/minideb:bookworm

SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c", "-x"]

ARG STANDARD_PACKAGES="locales ca-certificates curl sudo makepasswd uidmap git xonsh fish zsh csh tcsh ksh build-essential wget"

# ✅ install packages
# ✅ set up locale
ARG LOCALE=en_US
ENV LANG=${LOCALE}.UTF-8
ENV LC_ALL=${LOCALE}.UTF-8
ENV LANGUAGE=${LOCALE}.UTF-8
RUN \
apt-get update -qq; \
apt-get install -qq -y curl sudo makepasswd uidmap git xonsh fish zsh csh tcsh ksh build-essential wget 1>/dev/null; \
install_packages ${STANDARD_PACKAGES} ; \
localedef -i ${LOCALE} -c -f UTF-8 -A /usr/share/locale/locale.alias ${LOCALE}.UTF-8; \
echo "${LOCALE}.UTF-8 UTF-8" >> /etc/locale.gen; \
echo "LANG=${LOCALE}.UTF-8" >> /etc/locale.conf; \
locale-gen ${LOCALE}.UTF-8; \
echo 'me' > /tmp/pw; \
useradd -m -u 1000 -U -p "$(makepasswd --crypt-md5 --clearfrom=/tmp/pw)" me; \
echo "me ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers.d/me-sudo; \
Expand All @@ -17,6 +24,15 @@ curl -fsSL https://github.com/nushell/nushell/releases/download/0.100.0/nu-0.100
tar -xvf nu.tar.gz; \
mv nu-0.100.0-x86_64-unknown-linux-gnu/nu /usr/local/bin/nu;

# ✅ instal delta
RUN \
pushd /tmp; \
curl -fsSL https://github.com/dandavison/delta/releases/download/0.18.2/delta-0.18.2-x86_64-unknown-linux-gnu.tar.gz -O; \
tar -xvf delta-0.18.2-x86_64-unknown-linux-gnu.tar.gz; \
mv delta-0.18.2-x86_64-unknown-linux-gnu/delta /usr/local/bin/delta; \
popd; \
rm -rf /tmp/*

# now install bash 5.0
SHELL ["/bin/sh", "-o", "errexit", "-o", "nounset", "-x", "-c"]

Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.28.2553
0.28.2559

0 comments on commit a0f362b

Please sign in to comment.