update test #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 clean && make | |
- name: Run tests | |
run: make test | |
- name: Run simple test | |
run: make autotest | |
- name: Archive binary | |
uses: actions/upload-artifact@v4 | |
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 |