Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Minor: dropping deprecated functions for future support #9

Minor: dropping deprecated functions for future support

Minor: dropping deprecated functions for future support #9

Workflow file for this run

name: Unit Tests
on:
push:
paths:
- "**.fish"
- ".github/workflows/unit_tests.yml"
- "action.yml"
branches: [ master ]
pull_request:
paths:
- "**.fish"
- ".github/workflows/tests.yml"
- "action.yml"
branches: [ master ]
env:
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
jobs:
default_test:
name: Run with default settings
runs-on: ubuntu-latest
steps:
- name: Checkout current version
uses: actions/checkout@v3
- name: Create files to sync
run: |
mkdir docs/
mkdir docs/folder_a/
mkdir docs/folder_b/
touch docs/hello.md
touch docs/folder_a/nice.png
touch docs/folder_b/nice_tmp.png
touch docs/folder_a/dog.JPG
- name: Sync with local action
uses: ./
with:
source-directory: "./docs"
dry-run: true
id: default_test
- name: Test output
run: |
sol="./folder_a/dog.JPG ./folder_a/nice.png ./folder_b/nice_tmp.png ./hello.md"
res="${{ steps.default_test.outputs.sync_result }}"
[ "$sol" = "$res" ] || { echo "::error::Failed default settings test"; exit 1; }
only_include_test:
name: Include only png and md
runs-on: ubuntu-latest
steps:
- name: Checkout current version
uses: actions/checkout@v3
- name: Create files to sync
run: |
mkdir docs/
mkdir docs/folder_a/
mkdir docs/folder_a/sub_a/
touch docs/hello.md
touch docs/hello.png
touch docs/folder_a/nice.png
touch docs/folder_a/sub_a/nice.png
touch docs/folder_a/dog.JPG
- name: Sync with local action
uses: ./
with:
source-directory: "./docs"
dry-run: true
include-patterns: "*.md *.png"
id: only_include
- name: Test output
run: |
sol="./folder_a/nice.png ./folder_a/sub_a/nice.png ./hello.md ./hello.png"
res="${{ steps.only_include.outputs.sync_result }}"
[ "$sol" = "$res" ] || { echo "::error::Failed include only test"; exit 1; }
test_case_sensitivity:
name: Test case sensitivity
runs-on: ubuntu-latest
steps:
- name: Checkout current version
uses: actions/checkout@v3
- name: Create files to sync
run: |
mkdir docs/
mkdir docs/folder_a/
mkdir docs/folder_a/sub_a/
touch docs/hello.md
touch docs/hello.png
touch docs/folder_a/nice.png
touch docs/folder_a/sub_a/nice.png
touch docs/folder_a/sub_a/nice_extension.PNG
touch docs/folder_a/dog.JPG
- name: Sync with local action
uses: ./
with:
source-directory: "./docs"
dry-run: true
include-patterns: "*.md *.png"
id: case_sensitivity
- name: Test output
run: |
sol="./folder_a/nice.png ./folder_a/sub_a/nice.png ./hello.md ./hello.png"
res="${{ steps.case_sensitivity.outputs.sync_result }}"
[ "$sol" = "$res" ] || { echo "::error::Failed case sensitivity test"; exit 1; }
test_exclude_only:
name: Exclude only JPG and md files
runs-on: ubuntu-latest
steps:
- name: Checkout current version
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Create files to sync
run: |
mkdir docs/
mkdir docs/folder_a/
mkdir docs/folder_a/sub_a/
mkdir docs/folder_b/
touch docs/hello.md
touch docs/hello.png
touch docs/folder_a/nice.png
touch docs/folder_a/sub_a/nice.png
touch docs/folder_a/sub_a/nice_extension.PNG
touch docs/folder_b/nice_tmp.png
touch docs/folder_a/dog.JPG
- name: Sync with local action
uses: ./
with:
source-directory: "./docs"
dry-run: true
exclude-patterns: "*.md *.JPG"
id: exclude_only
- name: Test output
run: |
sol="./folder_a/nice.png ./folder_a/sub_a/nice.png ./folder_a/sub_a/nice_extension.PNG ./folder_b/nice_tmp.png ./hello.png"
res="${{ steps.exclude_only.outputs.sync_result }}"
[ "$sol" = "$res" ] || { echo "::error::Failed exclude_only test"; exit 1; }
test_include_and_exclude:
name: Include only *.pdf but ignore *.tmp.pdf files
runs-on: ubuntu-latest
steps:
- name: Checkout current version
uses: actions/checkout@v3
- name: Create files to sync
run: |
mkdir docs/
mkdir docs/folder_a/
mkdir docs/folder_b/
touch docs/hello.md
touch docs/hello.png
touch docs/hello.pdf
touch docs/folder_a/nice.png
touch docs/folder_a/nice.pdf
touch docs/folder_b/nice_tmp.png
touch docs/folder_b/nice.tmp.pdf
- name: Sync with local action
uses: ./
with:
source-directory: "./docs"
dry-run: true
include-patterns: "*.pdf"
exclude-patterns: "*.tmp.pdf"
id: include_exclude
- name: Test output
run: |
sol="./folder_a/nice.pdf ./hello.pdf"
res="${{ steps.include_exclude.outputs.sync_result }}"
[ "$sol" = "$res" ] || { echo "::error::Failed include_exclude test"; exit 1; }