Now I need Linux to test on.

Eventually I want to run Tipsy-Robot with the png generator on little micro-computer here in the house. Getting from developing on my Mac to that little nugget means cross checking everything on Linux.

Two examples on how to verify things work: a VM and a GitHub Action

Semi-Virtual VirtualBox

I use VirtualBox as my VM. Conveniences like being able to copy paste between windows makes working on a code base for both environments super easy.

Misc brief notes on setting up VirtualBox

  1. Go get Virtual Box:
  2. Install
  3. Go get ISO, ubuntu, LTS stands for Long Term Support
  4. New
  5. Setup Permission for VirtualBox “Input Monitoring”

Misc Other

Add Swift The Long Way

Official Instructions

sudo apt update
sudo apt upgrade
sudo apt install clang libicu-dev build-essential pkg-config

mkdir ~/swift
cd ~/swift
# go to for current links
tar xzf swift-5.8-RELEASE-ubuntu20.04.tar.gz #add v (xzvf) to see all files
mv swift-5.8-RELEASE-ubuntu22.04 5.8
# recommended choice: add a simlink to `swift` command to `/usr/bin/` 
# instead of adding version folder to $PATH. 
sudo ln -s ~/swift/5.8/usr/bin/swift /usr/bin/swift 
swift --version

Add what we need:

sudo apt install git 
sudo apt install gh  #optional
sudo apt install libpng-dev

mkdir ~/Documents/GitHub
cd ~/Documents/GitHub

gh auth login #
gh repo clone carlynorama/SwiftLIBPNG


cd SwiftLIBPNG
swift build

If installing VScode will also need sourcekit-lsp. Discussion:

Super Virtual Linux (Github Action)

Use action like one checking APITizer

name: Build Linux

      - '*'
      - main
    name: Build Linux
    runs-on: ubuntu-latest
      image: swift:latest
      - name: Checkout
        uses: actions/checkout@v3
      - name: Install sudo package
        run: apt update && apt install sudo
      - name: Install libpng
        run: |
          sudo apt-get install libpng-dev -y          
      - name: Build and Test
        run: |
           swift build
           swift test           

TODO: Cache the image with libpng?