Skip to content

test: add test.yml

test: add test.yml #1

Workflow file for this run

name: Test
on:
push:
pull_request:
jobs:
test-with-xdg-var:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
substituters = https://cache.garnix.io https://cache.nixos.org/
- id: create-temp-dir
run: mkdir -p $HOME/test-data-dir/
- id: run-wine
run: |
XDG_DATA_HOME=$HOME/test-data-dir/ nix run .#winetricks
- id: test-directory
run: |
if [ -d "$HOME/test-data-dir/affinity" ]; then
echo "$HOME/test-data-dir/affinity exists correctly"
else
echo "::error::Directory '$HOME/test-data-dir' does not exist"
exit 1
fi
test-without-xdg-var:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
substituters = https://cache.garnix.io https://cache.nixos.org/
- id: run-wine
run: |
unset XDG_DATA_HOME
nix run .#winetricks
- id: test-directory
run: |
if [ -d "$HOME/.local/share/affinity" ]; then
echo "Fell back without xdg_data_home correctly"
else
echo "::error::Directory '$HOME/.local/share/affinity' does not exist"
exit 1
fi