Skip to content

Commit

Permalink
ci(WIP): fix pure_enable_container_detection
Browse files Browse the repository at this point in the history
  • Loading branch information
edouard-lopez committed Feb 16, 2024
1 parent 1466ef7 commit 4824071
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 46 deletions.
74 changes: 28 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,53 +23,35 @@ on:
- ".github/**/*.yml"

jobs:
test-container:
name: Test on fish ${{ matrix.version.fish }} on Docker
runs-on: ubuntu-latest
strategy:
matrix:
version: [
{ fish: 3.3.1, alpine: 3.15 }, # for Ubuntu 22.04 LTS
{ fish: 3.6.3, alpine: 3.19 },
{ fish: 3.7.0, alpine: 'edge' },
# { fish: 3.6.2, alpine: 'edge' },
]
steps:
- uses: actions/checkout@v2
- run: make build-pure-on FISH_VERSION=${{ matrix.version.fish }}
- run: docker --version
- run: make test-pure-on FISH_VERSION=${{ matrix.version.fish }}
# test-container:
# name: Test on fish ${{ matrix.version.fish }} on Docker
# runs-on: ubuntu-latest
# strategy:
# matrix:
# version: [
# # { fish: 3.3.1, alpine: 3.15 }, # for Ubuntu 22.04 LTS
# # { fish: 3.6.3, alpine: 3.19 },
# # { fish: 3.7.0, alpine: 'edge' },
# # { fish: 3.6.2, alpine: 'edge' },
# ]
# steps:
# - uses: actions/checkout@v2
# - run: make build-pure-on FISH_VERSION=${{ matrix.version.fish }}
# - run: docker --version
# - run: make test-pure-on FISH_VERSION=${{ matrix.version.fish }}

test-nixos:
name: Test `pure` with Fish ${{ matrix.version.fish }} on NixOS container
runs-on: ubuntu-latest
strategy:
matrix:
version: [
{ fish: 3.7.0, alpine: 'edge' }, # https://search.nixos.org/packages?show=fish&type=packages&query=fish
]
steps:
- uses: actions/checkout@v2
- run: make build-pure-on-nix FISH_VERSION=${{ matrix.version.fish }}
- run: docker --version
- run: make test-pure-on-nix FISH_VERSION=${{ matrix.version.fish }}
# test-nixos:
# uses: ./.github/workflows/nixos.yml
# secrets: inherit

test-macos:
name: Test on fish on MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install Fish
run: brew install fish
- name: Install Fisher > Fishtape > Pure
run: curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher jorgebucaran/fishtape ./
shell: fish {0}
- name: Test Pure
run: fishtape tests/*.test.fish
shell: fish {0}

bump-version: # Bump when on master
needs: [test-container]
if: contains(github.ref, 'master')
uses: ./.github/workflows/bump-version.yml
if: true
uses: ./.github/workflows/macos.yml
secrets: inherit


# bump-version: # Bump when on master
# needs: [test-container]
# if: contains(github.ref, 'master')
# uses: ./.github/workflows/bump-version.yml
# secrets: inherit
21 changes: 21 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Test on MacOS

on:
workflow_call:

jobs:
test-macos:
name: Test on fish on MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: show os
run: uname -s
- name: Install Fish
run: brew install fish
- name: Install Fisher > Fishtape > Pure
run: curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher jorgebucaran/fishtape ./
shell: fish {0}
- name: Test Pure
run: fishtape tests/*.test.fish
shell: fish {0}
19 changes: 19 additions & 0 deletions .github/workflows/nixos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test on NixOS

on:
workflow_call:

jobs:
test-nixos:
name: Test `pure` with Fish ${{ matrix.version.fish }} on NixOS container
runs-on: ubuntu-latest
strategy:
matrix:
version: [
{ fish: 3.7.0, alpine: 'edge' }, # https://search.nixos.org/packages?show=fish&type=packages&query=fish
]
steps:
- uses: actions/checkout@v2
- run: make build-pure-on-nix FISH_VERSION=${{ matrix.version.fish }}
- run: docker --version
- run: make test-pure-on-nix FISH_VERSION=${{ matrix.version.fish }}
8 changes: 8 additions & 0 deletions tests/_pure_is_inside_container.test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ end
echo $called
) = once

if test (uname -s) != Darwin
@test "_pure_is_inside_container: check `uname -s`" (
cleanup_spy

test (uname -s) != Darwin
) $status -eq $SUCCESS
end

if test (uname -s) != Darwin
cleanup_spy
@test "_pure_is_inside_container: true for Github Action on Ubuntu" (
Expand Down

0 comments on commit 4824071

Please sign in to comment.