Skip to content

Commit

Permalink
Fix/linting (#1060)
Browse files Browse the repository at this point in the history
* Fix `golangci-lint` linting issues

* Update deprecated functions

* Update deprecated GitHub Actions

* Update Nextflow and Compliance Tests

* Fix `golangci-lint` issues

* Update GitHub Actions

* Fix test errors
  • Loading branch information
lbeckman314 authored Sep 25, 2024
1 parent 69999d2 commit 916fbad
Show file tree
Hide file tree
Showing 52 changed files with 468 additions and 487 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Funnel Build and Cache

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: 1.21

- name: Check out code
uses: actions/checkout@v2

- name: Cache Funnel binary
uses: actions/cache@v3
with:
path: ./funnel
key: ${{ runner.os }}-funnel-bin-${{ hashFiles('**/go.sum') }}-${{ github.ref }}
restore-keys: |
${{ runner.os }}-funnel-bin-${{ github.ref }}
${{ runner.os }}-funnel-bin-
- name: Build Funnel (if cache doesn't exist)
run: |
if [ ! -f ./funnel ]; then
make build
fi
- name: Cache Funnel binary (after build)
uses: actions/cache@v3
with:
path: ./funnel
key: ${{ runner.os }}-funnel-bin-${{ hashFiles('**/go.sum') }}-${{ github.ref }}

- name: Upload Funnel binary as artifact
uses: actions/upload-artifact@v4
with:
name: funnel
path: funnel
135 changes: 0 additions & 135 deletions .github/workflows/compliance-test.yaml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/compliance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Workflow for running the TES compliance suite against Funnel
#
# This includes the following steps:
# 1. Build Funnel and store the resulting binary artifact
# 2. Install tes-compliance-suite and run against every version of TES simultaneously
# 3. start-report-deployment: Send a dispatch to the funnel-compliance repository to generate and publish
# the tes-compliance-suite report to https://ohsu-comp-bio.github.io/funnel-compliance/
#
# Optionally debug via SSH
# Ref: https://fleetdm.com/engineering/tips-for-github-actions-usability
#
# To use this step uncomment and place anywhere in the build steps. The build will pause on this step and
# output a ssh address associated with the Github action worker. Helpful for debugging build steps and
# and intermediary files/artifacts.
#
# - name: "Debug: Package dependancies for tmate (CentOS)"
# run: |
# yum install -y xz
# ln -s /bin/true /bin/apt-get
#
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

name: Compliance Test

on:
push:
pull_request:

jobs:
build:
uses: ./.github/workflows/build.yml

compliance:
strategy:
fail-fast: false
matrix:
version: [1.0.0, 1.1.0]
db: ["boltdb", "mongodb"]
compute: ["local", "kubernetes"]
storage: ["local", "s3"]
needs: build
runs-on: ubuntu-latest
steps:
# Required to access the 'tests/mongo.config.yml' file
# Perhaps uploading it as an artifact would be more efficient?
- name: Check out code
uses: actions/checkout@v2

- uses: actions/download-artifact@v4
with:
name: funnel

- name: Start Funnel server
run: |
touch config.yml
if [ ${{ matrix.db }} = "mongodb" ]; then
make start-mongodb
cat `pwd`/tests/mongo.config.yml >> config.yml
fi
if [ ${{ matrix.storage }} = "s3" ]; then
docker run -d -p 9000:9000 --name minio \
-e "MINIO_ROOT_USER=minioadmin" \
-e "MINIO_ROOT_PASSWORD=minioadmin" \
-v /tmp/data:/data \
-v /tmp/config:/root/.minio \
minio/minio server /data
cat `pwd`/tests/s3.config.yml >> config.yml
fi
chmod +x funnel
./funnel server run --config `pwd`/config.yml &> funnel.logs &
- name: Run OpenAPI Test Runner
run: |
git clone https://github.com/elixir-cloud-aai/openapi-test-runner
cd openapi-test-runner
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python setup.py install
openapi-test-runner report --version "${{ matrix.version }}" --server "http://localhost:8000/"
38 changes: 8 additions & 30 deletions .github/workflows/nextflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,34 @@ name: Nextflow Test

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.21

- name: Check out code
uses: actions/checkout@v2

- name: Build Funnel (if cache does not exist)
run: make build
uses: ./.github/workflows/build.yml

- name: Store Funnel
uses: actions/upload-artifact@v2
with:
name: funnelBin
path: funnel

nextflow:
runs-on: ubuntu-latest
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Funnel
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: funnelBin
path: funnel
name: funnel

- name: Start Funnel
working-directory:
run: |
cd funnel/
chmod +x ./funnel
./funnel server --LocalStorage.AllowedDirs $HOME run &
- name: Install Nextflow
run: |
cd ..
git clone https://github.com/nextflow-io/nextflow/ -b tes-update-1.1
git clone https://github.com/nextflow-io/nextflow
cd nextflow
make compile
- name: Install nf-canary and GA4GH-TES plugin
run: |
cd ..
git clone https://github.com/seqeralabs/nf-canary
cd nf-canary
cat <<EOF >> nextflow.config
Expand All @@ -60,8 +39,7 @@ jobs:
process.executor = 'tes'
tes.endpoint = 'http://localhost:8000'
EOF
- name: Run nf-canary tests
run: |
cd ../nf-canary
../nextflow/launch.sh run main.nf
./nextflow/nextflow run nf-canary/main.nf
48 changes: 0 additions & 48 deletions .github/workflows/s3-test.yaml

This file was deleted.

Loading

0 comments on commit 916fbad

Please sign in to comment.