Skip to content

Commit

Permalink
Restructure base directory & add GitHub Actions builds/releases (smit…
Browse files Browse the repository at this point in the history
…h-chem-wisc#577)

* restructure base directory

* add github action workflows
  • Loading branch information
acesnik authored Mar 9, 2022
1 parent 3f71372 commit b36356f
Show file tree
Hide file tree
Showing 320 changed files with 111 additions and 6 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and Test

on:
push:
branches: [ restructureBaseDir ]
pull_request:
branches: [ restructureBaseDir ]

jobs:
build:
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Set up .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Restore dependencies
run: cd mzLib; dotnet restore
- name: Build
run:
cd mzLib;
dotnet build --no-restore;
dotnet build --no-restore ./Test/Test.csproj;
dotnet build --no-restore ./TestFlashLFQ/TestFlashLFQ.csproj;
- name: Add msbuild
run:
cd mzLib;
dotnet add Test/Test.csproj package coverlet.msbuild;
dotnet add TestFlashLFQ/TestFlashLFQ.csproj package coverlet.msbuild;
- name: Test
run:
cd mzLib;
dotnet test --no-build --verbosity normal
/p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
/p:CoverletOutput='../../coberturatest.xml'
./Test/Test.csproj;
dotnet test --no-build --verbosity normal
/p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
/p:CoverletOutput='../../coberturatestlfq.xml'
./TestFlashLFQ/TestFlashLFQ.csproj;
- name: Directory lists
run:
ls;
ls mzLib;
- name: Codecov
uses: codecov/codecov-action@v2
with:
verbose: true
files: ./coberturatest.xml,./coberturatestlfq.xml
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

jobs:
build:
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: Verify commit exists in origin/master
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/${env:RELEASE_BRANCH}
env:
RELEASE_BRANCH: master

- name: Restore dependencies
run: dotnet restore

- name: Build
run: |
$version= &git describe --tags
cd mzLib
dotnet build --no-restore --configuration Release /p:Version=${version}
- name: Test
run: |
$version= &git describe --tags
cd mzLib
dotnet test --configuration Release /p:Version=${version} --no-build
- name: Pack
run: |
$version= &git describe --tags
cd mzLib
dotnet pack --configuration Release /p:Version=${version} --no-build --output .
- name: Push
run: |
$version= &git describe --tags
cd mzLib
dotnet nuget push mzLib/mzLib.${version}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${env:GITHUB_TOKEN}
env:
GITHUB_TOKEN: ${{ secrets.NUGET_KEY }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,7 @@ ModelManifest.xml

# FAKE - F# Make
.fake/

# Macintosh files
**/.DS_Store

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
A library for mass spectrometry projects.



[![Build status](https://ci.appveyor.com/api/projects/status/s4wix633hmjv0jx4/branch/master?svg=true)](https://ci.appveyor.com/project/smith-chem-wisc/mzlib/branch/master)
[![codecov](https://codecov.io/gh/smith-chem-wisc/mzLib/branch/master/graph/badge.svg)](https://codecov.io/gh/smith-chem-wisc/mzLib)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/10000/badge.svg)](https://scan.coverity.com/projects/mzlib)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/1047dac2ae8d4d94b104c3cb3ca44926)](https://www.codacy.com/app/solntsev_2/mzLib?utm_source=github.com&utm_medium=referral&utm_content=smith-chem-wisc/mzLib&utm_campaign=Badge_Grade)
[![NuGet version (mzLib)](https://img.shields.io/nuget/v/mzLib.svg?style=flat-square)](https://www.nuget.org/packages/mzLib/)
[![GitHub Action Builds](https://github.com/smith-chem-wisc/mzLib/actions/workflows/dotnet.yml/badge.svg)](https://github.com/smith-chem-wisc/mzLib/actions/workflows/dotnet.yml)
[![codecov](https://codecov.io/gh/smith-chem-wisc/mzLib/branch/master/graph/badge.svg)](https://codecov.io/gh/smith-chem-wisc/mzLib)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/10000/badge.svg)](https://scan.coverity.com/projects/mzlib)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/1047dac2ae8d4d94b104c3cb3ca44926)](https://www.codacy.com/app/solntsev_2/mzLib?utm_source=github.com&utm_medium=referral&utm_content=smith-chem-wisc/mzLib&utm_campaign=Badge_Grade)
[![NuGet version (mzLib)](https://img.shields.io/nuget/v/mzLib.svg?style=flat-square)](https://www.nuget.org/packages/mzLib/)


Releases are here: https://www.nuget.org/packages/mzLib/
Expand Down Expand Up @@ -52,3 +51,4 @@ IEnumerable<ModificationWithLocation> ptms = PtmListLoader.ReadMods("ptms.txt")
```
# License
Code heavily borrowed from https://github.com/dbaileychess/CSMSL and distrubuted under the appropriate license, LGPL.

Loading

0 comments on commit b36356f

Please sign in to comment.