mirror of
https://github.com/actions/upload-pages-artifact.git
synced 2026-03-31 02:25:00 +00:00
Add tests
This commit is contained in:
37
.github/workflows/test.yml
vendored
Normal file
37
.github/workflows/test.yml
vendored
Normal file
@@ -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
|
||||||
10
script/new-artifact.sh
Executable file
10
script/new-artifact.sh
Executable file
@@ -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
|
||||||
Reference in New Issue
Block a user