Skip to content

Commit

Permalink
Add support for Azure pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
neil-lindquist committed Aug 10, 2019
1 parent 81d56ee commit 900b2c4
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 1 deletion.
78 changes: 78 additions & 0 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# based on https://github.com/realark/cl-sample-game/blob/master/azure-pipelines.yaml

trigger:
- master

variables:
SBCL_VERSION: sbcl-1.5.5
SBCL_OPTIONS: ""

jobs:
- job: 'CrossCompile'
strategy:
matrix:
mac:
target: 'x86_64-apple-darwin'
imageName: 'macos-10.13'
win:
target: 'x86_64-windows-10'
imageName: 'vs2017-win2016'
pool:
vmImage: $(imageName)
steps:
- script: |
curl -L https://sourceforge.net/projects/sbcl/files/sbcl/1.2.11/sbcl-1.2.11-x86-64-darwin-binary.tar.bz2/download?use_mirror=astuteinternet > darwin.tar.bz2
bzip2 -cd darwin.tar.bz2 | tar xvf -
cd sbcl-1.2.11-x86-64-darwin
sh install.sh
displayName: Mac Install SBCL
condition: eq( variables['Agent.OS'], 'Darwin' )
- script: |
curl -L https://sourceforge.net/projects/sbcl/files/sbcl/1.4.14/sbcl-1.4.14-x86-64-windows-binary.msi/download?use_mirror=pilotfiber > windows.msi
msiexec.exe /qn /i windows.msi
@echo ##vso[task.prependpath]C:\Program Files\sbcl\bin\
@echo ##vso[task.setvariable variable=sbcl_home]C:\Program Files\sbcl\lib\sbcl
displayName: Windows Install SBCL
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- script: |
cd $HOME
git clone https://github.com/sbcl/sbcl
cd sbcl
git checkout $(SBCL_VERSION)
sh make.sh --prefix=$SBCL_HOME $(SBCL_OPTIONS)
sudo sh install.sh
displayName: Build Special SBCL
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- bash: |
git clone https://github.com/sbcl/sbcl
cd sbcl
git checkout $(SBCL_VERSION)
export PATH="/c/Program Files/Steel Bank Common Lisp/1.4.14:$PATH"
export SBCL_HOME="/c/Program Files/Steel Bank Common Lisp/1.4.14"
sh make.sh $(SBCL_OPTIONS)
export SBCL_HOME=""
sh install.sh
displayName: Windows Build Special SBCL
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- bash: |
cd $HOME
curl -O http://beta.quicklisp.org/quicklisp.lisp
sbcl --load quicklisp.lisp --eval '(quicklisp-quickstart:install)' --eval '(ql-util:without-prompting (quicklisp:add-to-init-file))' --eval '(quit)'
displayName: Install Quicklisp
- bash: |
mkdir -p $HOME/quicklisp/local-projects/
ln -s '$(Build.SourcesDirectory)' $HOME/quicklisp/local-projects/cl-sample-game
displayName: Non-Windows Link Local Project
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- bash: |
echo "make folder"
mkdir -p "$HOME/quicklisp/local-projects/"
echo "do linking"
export WIN_HOME=`echo $HOME | sed -r 's#^/c#C:#g'`
cmd <<< "mklink /D \"${WIN_HOME//\//\\}\\quicklisp\\local-projects\cl-sample-game\" \"$(Build.SourcesDirectory)\""
displayName: Windows Link Local Project
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- script: |
sbcl --script roswell/run-fiveam.ros -l ci-utils/test :azure-pipelines-tests :base-tests :noncoveralls-tests
displayName: Run tests
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ Finally, if the `COVERALLS` environmental variable is set, then `:COVERALLS` is
| Circle CI | `:CIRCLE-CI` |
| Appveyor | `:APPVEYOR` |
| GitLab CI | `:GITLAB-CI` |
| Bitbucket Pipelines | `:bitbucket-pipelines` |
| Bitbucket Pipelines | `:BITBUCKET-PIPELINES` |
| Azure Pipelines | `:AZURE-PIPELINES` |
4 changes: 4 additions & 0 deletions src/ci-utils.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#+appveyor :appveyor
#+gitlab-ci :gitlab-ci
#+bitbucket-pipelines :bitbucket-pipelines
#+azure-pipelines :azure-pipelines
#+unknown-ci :unknown-ci
#-ci nil)

Expand All @@ -31,6 +32,7 @@
#+appveyor (string-upcase (uiop:getenv "APPVEYOR_BUILD_FOLDER") :end 1)
#+gitlab-ci (uiop:getenv "CI_PROJECT_DIR")
#+bitbucket-pipelines (uiop:getenv "BITBUCKET_CLONE_DIR")
#+azure-pipelines (uiop:getenv "AGENT_BUILDDIRECTORY")
#+(or (not ci) unknown-ci) (uiop:getcwd))


Expand All @@ -42,6 +44,7 @@
#+appveyor (not (null (uiop:getenvp "APPVEYOR_PULL_REQUEST_NUMBER")))
#+gitlab-ci (not (null (uiop:getenvp "CI_MERGE_REQUEST_ID")))
#+bitbucket-pipelines (not (null (uiop:getenvp "BITBUCKET_PR_ID")))
#+azure-pipelines (not (null (uiop:getenvp "SYSTEM_PULLREQUEST.PULLREQUESTID")))
#+(or (not ci) unknown-ci) nil)

(defun branch ()
Expand All @@ -53,4 +56,5 @@
#+gitlab-ci (uiop:getenvp "CI_COMMIT_REF_NAME")
#+bitbucket-pipelines (or (uiop:getenvp "BITBUCKET_BRANCH")
(uiop:getenvp "BITBUCKET_TAG"))
#+azure-pipelines (uiop:getenvp "BUILD_SOURSEBRANCHNAME")
#+(or (not ci) unknown-ci) nil)
1 change: 1 addition & 0 deletions src/features.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
((uiop:getenvp "APPVEYOR") :appveyor)
((uiop:getenvp "GITLAB_CI") :gitlab-ci)
((uiop:getenvp "BITBUCKET_BUILD_NUMBER") :bitbucket-pipelines)
((string-equal "true" (uiop:getenv "TF_BUILD")) :azure-pipelines)
(t :unknown-ci))
*features*))

Expand Down
7 changes: 7 additions & 0 deletions t/tests.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
(is (eq (not (null (uiop:getenvp "BITBUCKET_PR_ID")))
(pull-request-p))))

(test :azure-pipelines-tests
(is-true (member :azure-pipelines *features*))
(is-false (member :circleci *features*))
(is (eq :azure-pipelines (platform)))
(is (string= (uiop:getenv "BUILD_SOURSEBRANCHNAME") (branch)))
(is (eq (not (null (uiop:getenvp "SYSTEM_PULLREQUEST_PULLREQUESTID")))
(pull-request-p))))

(test :base-tests
(is-true (member :ci *features*))
Expand Down

0 comments on commit 900b2c4

Please sign in to comment.