![gal@spitfire.co.il](/assets/img/avatar_default.png)
![GitHub](/assets/img/avatar_default.png)
4 changed files with 139 additions and 85 deletions
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash |
||||
|
||||
OS="$(uname -s)" |
||||
|
||||
case $1 in |
||||
"fish") |
||||
CONFIG_DIR="$(fish -c 'echo -n $__fish_config_dir')" |
||||
echo "${CONFIG_DIR-"$HOME/.config/fish"}/fish.config" |
||||
;; |
||||
"zsh") |
||||
echo "$HOME/.zshrc" |
||||
;; |
||||
"bash") |
||||
if [ "$OS" = "Darwin" ]; then |
||||
echo "$HOME/.profile" |
||||
else |
||||
echo "$HOME/.bashrc" |
||||
fi |
||||
;; |
||||
*) |
||||
exit 1 |
||||
;; |
||||
esac |
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash |
||||
|
||||
DIRECTORY="$(dirname "$0")" |
||||
SHELL_TO_RUN="$1" |
||||
PROFILE_FILE="$("$DIRECTORY/get_shell_profile.sh" "$SHELL_TO_RUN")" |
||||
|
||||
echo "Profile is $PROFILE_FILE" |
||||
|
||||
$SHELL_TO_RUN -c ' |
||||
fnm install 12.5.0 |
||||
fnm ls | grep 12.5.0 |
||||
|
||||
echo "fnm ls worked." |
||||
' |
||||
|
||||
$SHELL_TO_RUN -c ' |
||||
fnm use 12.5.0 |
||||
node --version | grep 12.5.0 |
||||
|
||||
echo "node --version worked." |
||||
' |
@ -1,81 +1,77 @@
@@ -1,81 +1,77 @@
|
||||
name: Installation script |
||||
on: |
||||
pull_request: |
||||
paths: |
||||
- .ci/install.sh |
||||
push: |
||||
branches: |
||||
- master |
||||
paths: |
||||
- .ci/install.sh |
||||
|
||||
jobs: |
||||
install_on_linux: |
||||
runs-on: ubuntu-latest |
||||
test_against_latest_release: |
||||
name: Test against latest release |
||||
strategy: |
||||
matrix: |
||||
include: |
||||
- shell: fish |
||||
source: ~/.config/fish/config.fish |
||||
- shell: zsh |
||||
source: ~/.zshrc |
||||
- shell: bash |
||||
source: ~/.bashrc |
||||
shell: [fish, zsh, bash] |
||||
setup: |
||||
- os: ubuntu |
||||
script_arguments: '' |
||||
- os: macos |
||||
script_arguments: '' |
||||
- os: macos |
||||
script_arguments: '--force-no-brew' |
||||
runs-on: ${{ matrix.setup.os }}-latest |
||||
steps: |
||||
- uses: actions/checkout@v2 |
||||
- run: "sudo apt-get install -y ${{ matrix.shell }}" |
||||
name: Install shell |
||||
name: Install ${{matrix.shell}} using apt-get |
||||
if: matrix.setup.os == 'ubuntu' |
||||
- run: "brew install ${{ matrix.shell }}" |
||||
name: Install ${{matrix.shell}} using Homebrew |
||||
if: matrix.setup.os == 'macos' |
||||
- run: "cp ~/.bashrc ~/.bashrc.bak && echo '. ~/.bashrc.bak' > ~/.bashrc" |
||||
name: reset bashrc file |
||||
- run: "env SHELL=$(which ${{ matrix.shell }}) bash ./.ci/install.sh" |
||||
- run: "env SHELL=$(which ${{ matrix.shell }}) bash ./.ci/install.sh ${{ matrix.setup.script_arguments }}" |
||||
name: Run the installation script |
||||
- run: ./.ci/test_installation_script.sh ${{ matrix.shell }} |
||||
name: 'Test installation script' |
||||
|
||||
- run: | |
||||
${{ matrix.shell }} -c ' |
||||
source ${{ matrix.source }} |
||||
fnm install 12.5.0 |
||||
fnm ls | grep 12.5.0 |
||||
' |
||||
name: 'Install a Node version with `fnm install`' |
||||
|
||||
- run: | |
||||
${{ matrix.shell }} -c ' |
||||
source ${{ matrix.source }} |
||||
fnm use 12.5.0 |
||||
node --version | grep 12.5.0 |
||||
' |
||||
name: 'Check switching versions with `fnm use`' |
||||
|
||||
install_on_mac: |
||||
runs-on: macos-latest |
||||
strategy: |
||||
matrix: |
||||
include: |
||||
- shell: fish |
||||
source: ~/.config/fish/config.fish |
||||
- shell: zsh |
||||
source: ~/.zshrc |
||||
- shell: bash |
||||
source: ~/.bashrc |
||||
steps: |
||||
- uses: actions/checkout@v2 |
||||
- run: "brew install ${{ matrix.shell }}" |
||||
name: Install shell |
||||
- name: reset bashrc file |
||||
run: | |
||||
cp ~/.bashrc ~/.bashrc.bak |
||||
echo '. ~/.bashrc.bak' > ~/.bashrc |
||||
- run: "env SHELL=$(which ${{ matrix.shell }}) bash ./.ci/install.sh --force-install" |
||||
name: Run the installation script |
||||
# install_on_mac_binary: |
||||
# runs-on: macos-latest |
||||
# strategy: |
||||
# matrix: |
||||
# include: |
||||
# - shell: fish |
||||
# source: ~/.config/fish/config.fish |
||||
# - shell: zsh |
||||
# source: ~/.zshrc |
||||
# - shell: bash |
||||
# source: ~/.bashrc |
||||
# steps: |
||||
# - uses: actions/checkout@v2 |
||||
# - run: "brew install ${{ matrix.shell }}" |
||||
# name: Install shell |
||||
# - name: reset bashrc file |
||||
# run: | |
||||
# cp ~/.bashrc ~/.bashrc.bak |
||||
# echo '. ~/.bashrc.bak' > ~/.bashrc |
||||
# - run: "env SHELL=$(which ${{ matrix.shell }}) bash ./.ci/install.sh --force-install" |
||||
# name: Run the installation script |
||||
|
||||
- name: 'Install a Node version with `fnm install`' |
||||
run: | |
||||
${{ matrix.shell }} -c ' |
||||
source ${{ matrix.source }} |
||||
fnm install 12.5.0 |
||||
fnm ls | grep 12.5.0 |
||||
' |
||||
# - name: 'Install a Node version with `fnm install`' |
||||
# run: | |
||||
# ${{ matrix.shell }} -c ' |
||||
# source ${{ matrix.source }} |
||||
# fnm install 12.5.0 |
||||
# fnm ls | grep 12.5.0 |
||||
# ' |
||||
|
||||
- name: 'Check switching versions with `fnm use`' |
||||
run: | |
||||
${{ matrix.shell }} -c ' |
||||
source ${{ matrix.source }} |
||||
fnm use 12.5.0 |
||||
node --version | grep 12.5.0 |
||||
' |
||||
# - name: 'Check switching versions with `fnm use`' |
||||
# run: | |
||||
# ${{ matrix.shell }} -c ' |
||||
# source ${{ matrix.source }} |
||||
# fnm use 12.5.0 |
||||
# node --version | grep 12.5.0 |
||||
# ' |
||||
|
Loading…
Reference in new issue