This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Ubuntu Setup Script | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| ubuntu_versions: | |
| description: 'Comma-separated Ubuntu versions to use (e.g., 18.04, 20.04, 22.04, latest)' | |
| required: false | |
| default: '20.04,22.04,latest' | |
| jobs: | |
| run-script: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| ubuntu_version: ${{ fromJson('["20.04", "22.04", "latest"]') }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Update git submodules | |
| run: git submodule update --init | |
| - name: Run Script in Docker, Then Source zshrc | |
| run: | | |
| UBUNTU_VERSION=${{ matrix.ubuntu_version }} | |
| docker run --rm \ | |
| -v "$(pwd):/repo" \ | |
| -e DEBIAN_FRONTEND=noninteractive \ | |
| --entrypoint /bin/bash ubuntu:$UBUNTU_VERSION -c \ | |
| "apt-get update && apt-get install -y curl sudo && \ | |
| chmod +x /repo/ubuntu-setup.sh && \ | |
| DEBIAN_FRONTEND=noninteractive /repo/ubuntu-setup.sh && \ | |
| exec zsh -c 'source /repo/zshrc && echo \"✅ zshrc sourced!\" && exec zsh'" |