Skip to content

Update test_n50.yml

Update test_n50.yml #2

Workflow file for this run

name: N50 Calculator CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [created]
workflow_dispatch:
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc make zlib1g-dev
- name: Build N50 Calculator
run: make
- name: Run tests
run: make test
- name: Run simple test
run: make test-simple
- name: Archive binary
uses: actions/upload-artifact@v3
with:
name: n50-calculator
path: bin/n50
release-binary:
needs: build-and-test
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc make zlib1g-dev
- name: Build N50 Calculator
run: make
- name: Compress binary
run: |
tar -czvf n50-calculator-linux-amd64.tar.gz -C bin n50
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./n50-calculator-linux-amd64.tar.gz
asset_name: n50-calculator-linux-amd64.tar.gz
asset_content_type: application/gzip