forked from lcompilers/lpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We only run tests for macOS, since Linux and Windows are already tested on our other CI. The code is mirrored to Azure only if the GitLab CI environment variable SSH_PRIVATE_KEY_AZURE is set. Otherwise the Azure build are skipped.
- Loading branch information
Showing
4 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Azure Pipelines CI | ||
# Documentation of the syntax: | ||
# https://aka.ms/yaml | ||
|
||
jobs: | ||
# - job: Linux | ||
# pool: | ||
# vmImage: 'Ubuntu-16.04' | ||
# steps: | ||
# - script: echo Hello, world! | ||
|
||
- job: macOS | ||
pool: | ||
# List of preinstalled software on the macOS image: | ||
# https://github.com/Microsoft/azure-pipelines-image-generation/blob/master/images/macos/macos-Readme.md | ||
vmImage: 'macOS-10.13' | ||
steps: | ||
- bash: echo "##vso[task.prependpath]$CONDA/bin" | ||
displayName: Add conda to PATH | ||
- bash: sudo chown -R $USER $CONDA | ||
displayName: Take ownership of conda installation | ||
- script: ci/azure_install_macos.sh | ||
displayName: 'Install prerequisites' | ||
|
||
- script: | | ||
echo Add other tasks to build, test, and deploy your project. | ||
echo See https://aka.ms/yaml | ||
displayName: 'Run a multi-line script' | ||
# - job: Windows | ||
# pool: | ||
# vmImage: 'vs2017-win2016' | ||
# steps: | ||
# - script: echo Hello, world! | ||
# displayName: 'Run a one-line script' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
conda config --set always_yes yes --set changeps1 no | ||
conda info -a | ||
conda update -q conda | ||
conda install python=3.7 pytest llvmlite prompt_toolkit | ||
pip install antlr4-python3-runtime | ||
|
||
python grammar/asdl_py.py | ||
python grammar/asdl_py.py grammar/ASR.asdl lfortran/asr/asr.py ..ast.utils | ||
|
||
cd grammar | ||
curl -O https://www.antlr.org/download/antlr-4.7-complete.jar | ||
java -cp antlr-4.7-complete.jar org.antlr.v4.Tool -Dlanguage=Python3 -no-listener -visitor fortran.g4 -o ../lfortran/parser | ||
cd .. | ||
|
||
CFLAGS="-Wall -g -fPIC" | ||
gcc $CFLAGS -o lfort_intrinsics.o -c lfort_intrinsics.c | ||
ar rcs liblfortran.a lfort_intrinsics.o | ||
gcc -shared -o liblfortran.so lfort_intrinsics.o | ||
mkdir -p share/lfortran/lib | ||
mv liblfortran.a share/lfortran/lib/ | ||
mv liblfortran.so share/lfortran/lib/ | ||
|
||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
|
||
mkdir ~/.ssh | ||
chmod 700 ~/.ssh | ||
ssh-keyscan ssh.dev.azure.com >> ~/.ssh/known_hosts | ||
|
||
eval "$(ssh-agent -s)" | ||
|
||
set +x | ||
if [[ "${SSH_PRIVATE_KEY_AZURE}" == "" ]]; then | ||
echo "Error: SSH_PRIVATE_KEY_AZURE is empty." | ||
exit 1 | ||
fi | ||
# Generate the private/public key pair using: | ||
# | ||
# ssh-keygen -f deploy_key -N "" | ||
# | ||
# then set the $SSH_PRIVATE_KEY_AZURE environment variable in the GitLab-CI to | ||
# the base64 encoded private key: | ||
# | ||
# cat deploy_key | base64 -w0 | ||
# | ||
# and add the public key `deploy_key.pub` into the target git repository (with | ||
# write permissions). | ||
|
||
ssh-add <(echo "$SSH_PRIVATE_KEY_AZURE" | base64 -d) | ||
set -x | ||
|
||
pwd | ||
git branch -D $CI_COMMIT_REF_NAME || echo ok | ||
git checkout -t origin/$CI_COMMIT_REF_NAME | ||
git show-ref | ||
git remote -v | ||
git push git@ssh.dev.azure.com:v3/lfortran/lfortran/lfortran +$CI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME |