Skip to content

Commit

Permalink
Create GitHub actions CI pipeline for running test scripts (eficode-a…
Browse files Browse the repository at this point in the history
…cademy#265)

* Create CI pipeline running test scripts

* Fix CI definition

* Add execute access to test.sh

* Fix CI definition

* Make test.ps1 go through all exercises

* Add git user for submodules kata

* Add git user for submodules kata

* Fix setup.ps1 for submodules kata

* Add MacOS to GitHub actions jobs
  • Loading branch information
bothzoli authored Jul 1, 2020
1 parent 4f240c7 commit a8d39f4
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 4 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
setup-bash:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Run bash test scripts
shell: bash
run: |
chmod +x ./test.sh
./test.sh
setup-bash-macos:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2

- name: Run bash test scripts
shell: bash
run: |
chmod +x ./test.sh
./test.sh
setup-pwsh:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Run PowerShell Core test scripts
run: ./test.ps1
shell: pwsh
13 changes: 12 additions & 1 deletion submodules/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ Set-Location .\exercise
# Create remote repo
git init --bare remote


git config --local user.name "git-katas trainer bot"
git config --local user.email "git-katas@example.com"


# Clone it so that it is ready for the exercise
git clone remote component

# Commit a file to the component repo & push it to the remote
Set-Location .\component

Set-Content -Value "" -Path component.h
git add component.h
git commit -m "Touch component header"
Expand All @@ -23,8 +29,13 @@ Set-Location ..

# Create a product repo
git init product

Set-Location -Path .\product

git config --local user.name "git-katas trainer bot"
git config --local user.email "git-katas@example.com"

Set-Content -Value "" -Path .\product.h
git add .\product.h
git add .
git commit -m "Touch product header"
Set-Location ..
13 changes: 10 additions & 3 deletions test.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
cd basic-commits
.\setup.ps1
cd ..
Get-ChildItem -Attributes Directory |
ForEach-Object {
if ($(Get-ChildItem $_.Name setup.ps1))
{
Push-Location $_.Name
Write-Output "`nRunning setup script for kata $($_.Name)"
.\setup.ps1
Pop-Location
}
}

0 comments on commit a8d39f4

Please sign in to comment.