Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions for CI on Linux #69

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/linuxCI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Linux CI

on:
workflow_dispatch:

push:
branches:
- main

pull_request:
branches:
-main

jobs:
linux:
name: "CI - Linux - Dyalog APL ${{ matrix.dyalogVersion }} with .NET ${{ matrix.dotnetVersion }}"
runs-on: ubuntu-latest
timeout-minutes:
10
strategy:
matrix:
include:
- dyalogVersion: "19.0"
dotnetVersion: "8.x"
fail-fast: false
steps:
- name: Install Dyalog APL
run: |
DEBFILE=`curl -o - -s https://www.dyalog.com/uploads/php/download.dyalog.com/download.php?file=docker.metafile | awk -v v="${{ matrix.dyalogVersion }}" '$0~v && /deb/ {print $3}'`
curl -o /tmp/dyalog.deb ${DEBFILE}
sudo dpkg -i /tmp/dyalog.deb
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnetVersion }}
- name: Activate Tatin and Cider
run: LX="⎕SE.UCMD 'Tools.Activate all' ⋄ ⎕OFF" dyalog -b -s
- name: Checkout repository
uses: actions/checkout@v4
- name: Run tests
run: |
runTest="⎕PW←500"
runTest="${runTest} ⋄ ⎕SE.UCMD 'Cider.Version'"
runTest="${runTest} ⋄ ⎕SE.Cider.DEVELOPMENT←1"
runTest="${runTest} ⋄ opts←⎕NS '' ⋄ opts.(batch checkPackageVersions folder)←1 0 '.'"
runTest="${runTest} ⋄ ⎕SE.Cider.OpenProject opts"
runTest="${runTest} ⋄ #.Cider.TestCases.RunTestsForCI ⋄ ⎕OFF 1"
LX="${runTest}" dyalog -b -s
- name: Upload code coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: ./TestResults/CodeCoverage.html
6 changes: 3 additions & 3 deletions APLSource/TestCases/Prepare.aplf
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
flag←0
:If ⎕NEXISTS testPath
:If ⎕NEXISTS testFilename,'.profile'
ind←('Code Coverage' 0 1)CommTools.Select'Append' 'Replace' 'Neither'
ind←('CodeCoverageExists@Code Coverage' 0 1)CommTools.Select'Append' 'Replace' 'Neither'
→(3=ind)/0
flag←1
:If 2=ind
1 CodeCoverage.DeleteFiles testFilename
:EndIf
:Else
flag←0 CommTools.YesOrNo'Code coverage?'
flag←0 CommTools.YesOrNo'CodeCoverage@Code coverage?'
:EndIf
:Else
flag←0 CommTools.YesOrNo'Code coverage?'
flag←0 CommTools.YesOrNo'CodeCoverage@Code coverage?'
:EndIf
:If flag
3 ⎕MKDIR testPath ⍝
Expand Down
22 changes: 22 additions & 0 deletions APLSource/TestCases/RunTestsForCI.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
RunTestsForCI;rc;log
⍝ Runs all test with the batch flag on and the debug flag off,
⍝ prints the messages from the test run
⍝ and closes the APL session with return code 0 if the test run
⍝ was successful and return code 1 if not.\\
⍝ This test runner function is meant to be used for a CI
⍝ pipeline.

⍝ Always produce code coverage report
CommTools.YesOrNo_Answers←1 2⍴'CodeCoverage@' 'y'
⍝ Always replace a code coverage report if it is already present
CommTools.Select_Choices←1 2⍴'CodeCoverageExists@' 2
Prepare
(rc log)←T.RunBatchTests 0
⎕←↑log

:If 0<≢T.codeCoverage
{}CodeCoverage.ProcessData T.codeCoverage.filename
{}1 CodeCoverage.CreateReport T.codeCoverage.filename
:EndIf

⎕OFF rc