-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (53 loc) · 1.43 KB
/
test_n50.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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