diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72ecf965..f21d5d6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,15 +1,18 @@ name: ci -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - workflow_dispatch: +on: [push, pull_request] jobs: - build: + linux: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: Run a one-line script run: ./ci.sh + macos: + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - name: Run a one-line script + shell: bash + run: ./ci.sh + diff --git a/ci.sh b/ci.sh index 49f971b3..e09d926d 100755 --- a/ci.sh +++ b/ci.sh @@ -12,24 +12,31 @@ main() { maybe_sudo="sudo" fi + local os + os="$(uname)" if ! available autopep8; then - if available apt; then - $maybe_sudo apt install -y python3-autopep8 - else - $maybe_sudo dnf install -y python3-autopep8 - fi + if [ "$os" = "Linux" ]; then + if available apt; then + $maybe_sudo apt install -y python3-autopep8 + else + $maybe_sudo dnf install -y python3-autopep8 + fi + fi fi - ./container_build.sh - curl -fsSL https://raw.githubusercontent.com/containers/ramalama/main/install.sh | sudo bash + chmod +x ramalama install.sh + if [ "$os" = "Linux" ]; then + ./container_build.sh + $maybe_sudo ./install.sh # todo macos support + autopep8 --exit-code ramalama # Check style is correct + shellcheck -- *.sh + fi set +o pipefail - chmod +x ramalama ./ramalama -h | grep Usage: set -o pipefail ./ramalama pull tinyllama - autopep8 --exit-code ramalama # Check style is correct # ramalama list | grep granite-code # ramalama rm granite-code } diff --git a/install.sh b/install.sh index 9a02588f..f0593d8e 100755 --- a/install.sh +++ b/install.sh @@ -16,22 +16,6 @@ amd_lshw() { lshw -c display -numeric -disable network | grep -q 'vendor: .* \[1002\]' } -gpu_check() { - if available lspci && lspci -d '10de:' | grep -q 'NVIDIA'; then - nvidia_available="true" - elif available lshw && nvidia_lshw; then - nvidia_available="true" - elif available nvidia-smi; then - nvidia_available="true" - fi - - if available lspci && lspci -d '1002:' | grep -q 'AMD'; then - amd_available="true" - elif available lshw && amd_lshw; then - amd_available="true" - fi -} - download() { local curl_cmd=("curl" "--globoff" "--location" "--proto-default" "https") curl_cmd+=("-o" "$from" "--remote-time" "--retry" "10" "--retry-max-time") @@ -68,8 +52,6 @@ main() { install -D -m755 "$from" "$bindir/" if false; then # to be done - local nvidia_available="false" - local amd_available="false" gpu_check fi }