Skip to content

Commit

Permalink
Jul 17, 2024: Test actions pt2
Browse files Browse the repository at this point in the history
  • Loading branch information
AldhairMedico committed Jul 17, 2024
1 parent 63ab90a commit 4398db1
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 18 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
validate is automatically run on pushes to any branch, or pull requests to main

to automatically create a new release and automatically upload mac, ubuntu, and windows builds run:
`git tag v*`
`git push origin v*`
where * is the version number.

Example:
`git tag v1.2.1`
`git push origin v1.2.1`
66 changes: 66 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Create Release

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: teloscope ${{ github.ref }}
body: |
Changes in this Release
draft: false
prerelease: false
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}

add_resources:
needs: create_release
name: Add Resources
strategy:
matrix:
OS: [macos-latest, ubuntu-latest, windows-2019]
include:
- OS: macos-latest
OS_NAME: macOS
- OS: ubuntu-latest
OS_NAME: linux
- OS: windows-2019
OS_NAME: win
runs-on: ${{ matrix.OS }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
- name: Build
run: make
- name: Zip
uses: papeloto/action-zip@v1
with:
files: build/bin/teloscope
dest: result.zip
- name: Add binaries
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: result.zip
asset_name: teloscope.${{ github.ref_name }}-${{matrix.OS_NAME}}.zip
asset_content_type: application/zip
1 change: 1 addition & 0 deletions .github/workflows/val.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"build/bin/teloscope-validate.exe" validateFiles
1 change: 1 addition & 0 deletions .github/workflows/val.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/bin/teloscope-validate validateFiles
33 changes: 33 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Validate

on:
push:
pull_request:
branches: [ main ]

jobs:
validate:
name: Validate
strategy:
matrix:
include:
- os: macos-latest
command: ".github/workflows/val.sh"
- os: ubuntu-latest
command: ".github/workflows/val.sh"
chmod: true
- os: windows-2019
command: ".github/workflows/val.bat"
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true
- name: Build
run: make all -j
- name: Validate
run: |
chmod +x .github/workflows/val.sh
${{ matrix.command }}
20 changes: 2 additions & 18 deletions src/generate-tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,11 @@ int main(int, char **argv) {

const std::map<std::set<std::string>, std::vector<std::string>> file_args = {
{{"random1.fasta"}, {"-f testFiles/random1.fasta -w 3 -s 1"}},
{{"random2.fasta"}, {"-f testFiles/random2.fasta -w 10 -s 5"}}
{{"random2.fasta"}, {"-f testFiles/random2.fasta -w 10 -s 5"}},
{{"random3.fasta"}, {"-f testFiles/random3.fasta -w 10 -s 5"}}
// {{set of test file paths}, {list of command line args to run with}}
};

// const std::map<std::set<std::string>, std::vector<std::string>> ext_args = {
// {{"fasta", "fasta.gz", "fastq", "fastq.gz"}, {"", "-s s", "-s c", "-s g", "-b a", "-b s", "-b c", "-b g", "--homopolymer-compress 1 -ofa"}},
// {{"gfa", "gfa.gz", "gfa2", "gfa2.gz"}, {"-o gfa2", "-o gfa", "-o fasta"}}
// // {{set of test file extensions}, {list of command line args to run with}}
// };

// const std::map<std::set<std::string>, std::vector<std::string>> file_args = {
// {{"random1.fasta", "random1.fasta.gz", "random1.fastq", "random1.fastq.gz", "random1.gfa2"}, {"-a testFiles/random1.agp --stats", "-a testFiles/random1.agp -ofa", "-k testFiles/random1.rvcp.sak", "-k testFiles/random1.mask.sak"}},
// {{"random1.fasta"}, {"-k testFiles/random1.instructions.sak", "-ofa -k testFiles/random1.instructions.sak", "-ofa -k testFiles/random1.hc.sak", "-ofa -k testFiles/random1.hdc.sak", "Header2", "-ofa -i testFiles/random1.fasta.bed", "-ofa -e testFiles/random1.fasta.bed"}},
// {{"random2.noseq.gfa"}, {""}},
// {{"random1.gfa2"}, {"-k testFiles/random1.gfa2.instructions.sak"}},
// {{"random4.fasta"}, {""}},
// {{"random5.findovl.gfa"}, {"--discover-terminal-overlaps 3 -ogfa"}}

// // {{set of test file paths}, {list of command line args to run with}}
// };

const std::set<std::string> exclude {"agp", "sak"};

for(const std::string &file : list_dir("testFiles")) {
Expand Down

0 comments on commit 4398db1

Please sign in to comment.