From 6b3212610ff09d835bfde300f85c0f6bdec3ef79 Mon Sep 17 00:00:00 2001 From: Yoann Chaudet Date: Thu, 18 Aug 2022 16:33:31 -0700 Subject: [PATCH] Add tests --- .github/workflows/test.yml | 37 +++++++++++++++++++++++++++++++++++++ script/new-artifact.sh | 10 ++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/test.yml create mode 100755 script/new-artifact.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f75ea84 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,37 @@ +name: Run Tests + +on: + push: + branches: + - main + pull_request: + +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Generate artifacts + run: mkdir artifact && mkdir artifact2 && cd artifact && ../script/new-artifact.sh + shell: bash + + - name: Upload artifacts + uses: . + with: + path: artifact + + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: github-pages + path: artifact2 + + - name: Compare artifacts + run: diff -qr artifact artifact2 + shell: bash diff --git a/script/new-artifact.sh b/script/new-artifact.sh new file mode 100755 index 0000000..f2614fd --- /dev/null +++ b/script/new-artifact.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Create some files and directories in the current folder +echo 'hello' > hello.txt +mkdir subdir +echo 'world' > subdir/world.txt + +# Add some symlinks (which we should dereference properly when archiving) +ln -s subdir subdir-link +ln -s hello.txt bonjour.txt