Test_WSL_Debian_12.yml - run the test for matrix of distros #84
This file contains 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: WSL_Debian_12 - iniPC script | |
# TODO try using platform matrix and a single file for Ubuntu and Debian | |
# TODO - set trigger paths, remove unnecessary commands, unify with Ubuntu script | |
# TODO test | |
# TODO merge WSL_Debian and WSL_Ubuntu_22.04 CI into a single .yml file | |
# TODO Debian fails to build because of this bug: https://github.com/llvm/llvm-project/issues/62475 | |
on: | |
push: | |
branches: [ "devel", "testing", "stable", "minimal" ] | |
paths: | |
- 'run_init.sh' | |
- 'prelude.sh' | |
- 'CommonInitScripts/*.sh*' | |
- '.github/workflows/Test_WSL_Debian_12.yml' | |
- 'WSL_Ubuntu_22.04/*.sh' | |
- 'WSL_Debian_12/*.sh' | |
pull_request: | |
branches: [ "devel", "testing", "stable", "minimal" ] | |
paths: | |
- 'run_init.sh' | |
- 'prelude.sh' | |
- 'CommonInitScripts/*.sh*' | |
- '.github/workflows/Test_WSL_Debian_12.yml' | |
- 'WSL_Ubuntu_22.04/*.sh' | |
- 'WSL_Debian_12/*.sh' | |
jobs: | |
distro-test: | |
continue-on-error: true | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
container: | |
- 'ubuntu:23.10' # https://hub.docker.com/_/ubuntu | |
- 'ubuntu:22.04' | |
- 'debian:12' # https://hub.docker.com/_/debian | |
- 'kalilinux/kali-rolling' # https://hub.docker.com/r/kalilinux/kali-rolling | |
container: | |
image: ${{ matrix.container }} | |
steps: | |
# - name: "set APT to non-interactive" | |
# shell: bash | |
# run: "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections" | |
- name: "Update APT" | |
run: "apt-get update -y" | |
- name: "Install `git` and `sudo`" | |
run: "apt-get install -y git sudo" | |
- name: "Checkout repo" | |
uses: actions/checkout@v4 | |
- name: print `github.ref=${{ github.ref }}` | |
run: echo ${{ github.ref }} | |
- name: print `github.sha=${{ github.sha }}` | |
run: echo ${{ github.sha }} | |
- name: Running iniPC script for the 1st time should not fail. | |
run: ./run_init.sh --noninteractive | |
- name: save ~/ for idempotency test | |
run: cp -r ~/ /tmp/old_home/ | |
- name: Running iniPC script for the 2nd time should not fail. | |
run: ./run_init.sh --noninteractive | |
# TODO split this command to multiple lines | |
# TODO also test that the first run of initPC script does change the state of home dir | |
# TODO - test whether the test works as expected | |
# TODO sync the idempotency test between linux distros (this is the most recent) | |
- name: The initPC script should be idempotent on ~/ directory (WIP - needs testing) | |
run: | | |
cd ~ | |
pwd | |
find . -type f \( ! -iname "*.log" ! -path "*/.dotfiles/logs/HEAD" \ | |
! -path "*work/_temp/*" ! -path "./runners/*" \ | |
! -path "./x/helix/target/release/.fingerprint/*" \ | |
! -path "./.cargo/registry/index/*" \ | |
! -path "./x/helix/target/release/build/helix-term*" \ | |
! -path "./x/helix/target/.rustc_info.json" \ | |
! -name ".wget-hsts" \) -print0 | | |
xargs -0 -I{} bash -c 'if ! diff -C 30 "/tmp/old_home/$1" "$1"; then echo "diff failed for: $1"; exit 1; fi' bash {} |