--- name: "e2e" on: workflow_dispatch: pull_request: branches: ["main"] concurrency: group: ${{ github.workflow }}-${{ github.event.number || github.ref }} cancel-in-progress: true jobs: yay: name: yay runs-on: ubuntu-latest container: image: greyltc/archlinux-aur:yay options: --user root steps: - name: Checkout uses: actions/checkout@v4 - name: Test Arch dependencies shell: bash run: >- sudo -E -u ab -D~ bash -c ' cd $GITHUB_WORKSPACE; yay -Syu --needed --noconfirm --noprogressbar go-task; go-task workstation:yay ' configure: name: configure runs-on: ubuntu-latest strategy: fail-fast: false matrix: config-files: - k0s - k3s-ipv4 - k3s-ipv6 - k3s-no-kube-vip addon-files: ["addons"] steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Homebrew id: setup-homebrew uses: Homebrew/actions/setup-homebrew@master - name: Setup Python uses: actions/setup-python@v5 id: setup-python with: python-version: "3.12" - name: Cache homebrew packages if: ${{ github.event_name == 'pull_request' }} uses: actions/cache@v3 id: cache-homebrew-packages with: key: homebrew-${{ runner.os }}-${{ steps.setup-homebrew.outputs.gems-hash }}-${{ hashFiles('.taskfiles/Workstation/Brewfile') }} path: /home/linuxbrew/.linuxbrew - name: Cache venv if: ${{ github.event_name == 'pull_request' }} uses: actions/cache@v3 with: key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('requirements.txt', 'requirements.yaml') }} path: .venv - name: Setup Workflow Tools if: ${{ github.event_name == 'pull_request' && steps.cache-homebrew-packages.outputs.cache-hit != 'true' }} shell: bash run: brew install go-task - name: Install Brew dependencies if: ${{ github.event_name == 'pull_request' && steps.cache-homebrew-packages.outputs.cache-hit != 'true' }} shell: bash run: task workstation:brew - name: Initialize Direnv shell: bash run: direnv allow . - name: Initialize Sops Age key shell: bash run: task sops:age-keygen - name: Install Ansible dependencies shell: bash run: task ansible:deps force=false - name: Generate bootstrap config file shell: bash run: | task init cp ./.github/tests/config-${{ matrix.config-files }}.yaml ./bootstrap/vars/config.yaml cp ./.github/tests/${{ matrix.addon-files }}.yaml ./bootstrap/vars/addons.yaml export BOOTSTRAP_AGE_PUBLIC_KEY=$(sed -n 's/# public key: //gp' age.key) envsubst < ./bootstrap/vars/config.yaml | sponge ./bootstrap/vars/config.yaml - name: Export Env from config.yaml shell: bash id: config-env run: | echo "distribution=$(yq '.bootstrap_distribution' ./bootstrap/vars/config.yaml)" >> $GITHUB_OUTPUT - name: Run configure shell: bash run: task configure --yes - name: Run Ansible lint if: ${{ steps.config-env.outputs.distribution == 'k3s' || steps.config-env.outputs.distribution == 'k0s' }} shell: bash run: task ansible:lint - name: List Hosts with Ansible if: ${{ steps.config-env.outputs.distribution == 'k3s' || steps.config-env.outputs.distribution == 'k0s' }} shell: bash run: task ansible:list - name: Run repo clean and reset shell: bash run: | task repo:clean task repo:reset --yes