Skip to content

Commit

Permalink
downloading conda in macOS CI tests (#169)
Browse files Browse the repository at this point in the history
* downloading conda in macOS CI tests

* Fix ubuntu CI (#170)

* Use mamba, ignore ubuntu error

* Fix CXXFLAGS for ignoring error

* Install clang-format and clang-tidy using conda

* Fixes for clang-format

* Only run clang-format for long-to-linked-pe

---------

Co-authored-by: Lauren Coombe <lauren.e.coombe@gmail.com>
  • Loading branch information
emilyyzhangg and lcoombe authored Oct 2, 2024
1 parent 8731c3e commit 067e1ee
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 36 deletions.
20 changes: 10 additions & 10 deletions Arcs/Arcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@

#define PROGRAM "arcs"

static const char VERSION_MESSAGE[] =
PROGRAM " " PACKAGE_VERSION "\n"
"\n"
"http://www.bcgsc.ca/platform/bioinfo/software/links \n"
"We hope this code is useful to you - If you have any questions or suggestions, please open an "
"issue at https://github.com/bcgsc/arcs.\n"
"If you use LINKS, ARCS code or ideas, please cite our work. \n"
"\n"
"LINKS and ARCS Copyright (c) 2014-present Canada's Michael Smith Genome Science Centre. "
"All rights reserved. \n";
static const char VERSION_MESSAGE[] = PROGRAM
" " PACKAGE_VERSION "\n"
"\n"
"http://www.bcgsc.ca/platform/bioinfo/software/links \n"
"We hope this code is useful to you - If you have any questions or suggestions, please open an "
"issue at https://github.com/bcgsc/arcs.\n"
"If you use LINKS, ARCS code or ideas, please cite our work. \n"
"\n"
"LINKS and ARCS Copyright (c) 2014-present Canada's Michael Smith Genome Science Centre. "
"All rights reserved. \n";

static const char USAGE_MESSAGE[] =
PROGRAM " " PACKAGE_VERSION "\n"
Expand Down
12 changes: 8 additions & 4 deletions Arcs/Arcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ struct ArcsParams
, j_index(0.55)
, threads(1)
, arks(false)
{}
{
}
};
/** A contig end: (FASTA ID, head?) */
typedef std::pair<std::string, bool> CI;
Expand Down Expand Up @@ -177,7 +178,8 @@ struct EdgeProperties
, dist(std::numeric_limits<int>::max())
, maxDist(std::numeric_limits<int>::max())
, jaccard(-1.0f)
{}
{
}
};

template<class GraphT>
Expand All @@ -190,7 +192,8 @@ struct EdgePropertyWriter

EdgePropertyWriter(GraphT& g)
: m_g(g)
{}
{
}

void operator()(std::ostream& out, const E& e) const
{
Expand Down Expand Up @@ -220,7 +223,8 @@ struct VertexPropertyWriter

VertexPropertyWriter(GraphT& g)
: m_g(g)
{}
{
}
void operator()(std::ostream& out, const V& v) const { out << " [id=" << m_g[v].id << "]"; }
};

Expand Down
9 changes: 6 additions & 3 deletions Arcs/DistanceEst.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ struct DistanceEstimate
, dist(0)
, maxDist(0)
, jaccard(0.0)
{}
{
}
};

/**
Expand All @@ -47,7 +48,8 @@ struct DistSample
, barcodesTail(0)
, barcodesUnion(0)
, barcodesIntersect(0)
{}
{
}
};

/** maps contig ID => intra-contig distance/barcode sample */
Expand All @@ -71,7 +73,8 @@ struct BarcodeStats
, barcodes2(0)
, barcodesUnion(0)
, barcodesIntersect(0)
{}
{
}
};

/** possible contig pair orientations (e.g. HH = head-to-head) */
Expand Down
34 changes: 16 additions & 18 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@ jobs:
displayName: Create Anaconda environment
- script: |
source activate arcs_CI
conda install --yes -c conda-forge -c bioconda compilers btllib boost automake sparsehash
conda install --yes -c conda-forge -c bioconda compilers btllib boost automake sparsehash clang-format clang-tools python pylint
displayName: Install dependencies
- script: |
source activate arcs_CI
./autogen.sh
./configure
./configure CXXFLAGS="${CXXFLAGS} -Wno-error=dangling-reference"
make
./Arcs/arcs --version
displayName: Compile ARCS
- script: |
source activate arcs_CI
conda install --yes --quiet --name arcs_CI python pylint
displayName: Install Python packages
make -C Arcs clang-format
make -C src clang-format
displayName: Run clang-format
- script: |
source activate arcs_CI
cd Examples
Expand All @@ -34,17 +35,6 @@ jobs:
source activate arcs_CI
make distcheck
displayName: Compile ARCS with make distcheck
- script: |
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-11 main"
sudo apt-get update
sudo apt-get install -y --no-install-recommends clang-format clang-tidy
displayName: Install clang-format and clang-tidy
- script: |
source activate arcs_CI
make -C Arcs clang-format
make -C src lint
displayName: Run clang-format
- script: |
source activate arcs_CI
make -C src all
Expand All @@ -56,13 +46,21 @@ jobs:
vmImage: 'macOS-latest'

steps:
- script: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- script: |
mkdir -p ~/miniforge3
curl -L https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh -o ~/miniforge3/miniforge.sh
bash ~/miniforge3/miniforge.sh -b -u -p ~/miniforge3
rm -rf ~/miniforge3/miniforge.sh
~/miniforge3/bin/conda init bash
~/miniforge3/bin/conda init zsh
export CONDA=$(realpath ~/miniforge3/bin)
echo "##vso[task.prependpath]$CONDA"
displayName: Install conda
- script: conda create --yes --quiet --name arcs_CI
displayName: Create Anaconda environment
- script: |
source activate arcs_CI
conda install --yes -c conda-forge -c bioconda compilers btllib boost automake sparsehash
mamba install --yes -c conda-forge -c bioconda compilers btllib boost automake sparsehash
displayName: Install dependencies
- script: |
source activate arcs_CI
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ lint: clang-format clang-tidy

# Check the C++ source code for errors with clang-tidy.
clang-tidy:
clang-tidy -warnings-as-errors='*' *.cpp -- -std=c++11 -x c++ ${CXXFLAGS}
clang-tidy -warnings-as-errors='*' *.cpp -- -x c++ ${CXXFLAGS}

# Check the C++ source code for white-space errors with clang-format.
clang-format:
Expand Down

0 comments on commit 067e1ee

Please sign in to comment.