Skip to content

Commit

Permalink
special issues testing (#246)
Browse files Browse the repository at this point in the history
use only one test
  • Loading branch information
joergi authored Sep 30, 2024
1 parent c0f465b commit c738d44
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 26 deletions.
42 changes: 17 additions & 25 deletions .github/workflows/testing-special-issues.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# This is a basic workflow to help you get started with Actions

name: Testing special issues

# Controls when the action will run. Triggers the workflow on push or pull request
Expand All @@ -13,46 +11,40 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
special-powershell:
runs-on: windows-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Download Special Issues windows
id: specialIssues
shell: pwsh
run: ./windows/magpi-special-issue-downloader.ps1
- name: lslah issues
run: Get-ChildItem –path D:\a\MagPiDownloader\MagPiDownloader\windows\special_issues
- name: "Check file existence Windows special"
id: check_files
uses: andstor/file-existence-action@v3.0.0
with:
files: "./windows/special_issues/Essentials_Games_v1.pdf"
fail: true
- name: File exists
if: steps.check_files.outputs.files_exists == 'false'
run: exit 1

special-issues:
strategy:
matrix:
os: [ macos, ubuntu ]
os: [ macos, ubuntu, windows]
fail-fast: false # Allows to see results from other combinations
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set OS-specific variables for Windows
if: matrix.os == 'windows'
run: |
echo "OS_PATH=windows" >> $GITHUB_ENV
echo "OS_FILE_EXTENSION=ps1" >> $GITHUB_ENV
shell: bash

- name: Set OS-specific variables for macOS and Ubuntu
if: matrix.os != 'windows'
run: |
echo "OS_PATH=linux_mac" >> $GITHUB_ENV
echo "OS_FILE_EXTENSION=sh" >> $GITHUB_ENV
shell: bash
- name: Download Special Issues linux
id: specialIssues
run: bash ./linux_mac/magpi-special-issue-downloader.sh
run: ./${{ env.OS_PATH }}/magpi-special-issue-downloader.${{ env.OS_FILE_EXTENSION }}

- name: "Check file existence Linux special issues"
- name: "Check file existence for special issues"
id: check_files
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
with:
files: "special_issues/MagPiSE1.pdf, special_issues/Projects_Book_v3.pdf, special_issues/Retro_Gaming.pdf, special_issues/C_and_GUI_Programming_2nd_Edition.pdf"
fail: true
- name: lslah
run: ls -lah special_issues/
shell: bash
- name: File exists
if: steps.check_files.outputs.files_exists == 'false'
run: exit 1
3 changes: 2 additions & 1 deletion windows/magpi-special-issue-downloader.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
# USAGE="Usage: pwshl magpi-special-issue-downloader.ps1"

$BASEDIR = Split-Path $MyInvocation.MyCommand.Path -Parent
$OUTDIR = Join-Path $BASEDIR "special_issues"
$PARENTDIR = Split-Path $BASEDIR -Parent
$OUTDIR = Join-Path $PARENTDIR "special_issues"

if (!(Test-Path $OUTDIR -PathType Container)) {
New-Item -ItemType Directory -Path $OUTDIR | Out-Null
Expand Down

0 comments on commit c738d44

Please sign in to comment.