Skip to content

Commit

Permalink
Adding CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
Damien committed Aug 8, 2024
1 parent b7cd538 commit 5995e58
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release

on:
push:
tags:
- '*'
env:
CARGO_TERM_COLOR: always

jobs:
build:
env:
FILE_NAME: flora_parsing
runs-on: ${{ matrix.os }}
permissions: write-all
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest,macOS-latest,windows-latest]

steps:
- uses: actions/checkout@v4
- name: Run tests
run: cargo test --verbose
- name: release
run: cargo build --release

- name: rename
if: matrix.os != 'windows-latest'
run: mv ./target/release/${{ env.FILE_NAME }} ./target/release/${{ matrix.os }}-${{ env.FILE_NAME }}
- name: rename windows
if: matrix.os == 'windows-latest'
run: mv ./target/release/${{ env.FILE_NAME }}.exe ./target/release/${{ matrix.os }}-${{ env.FILE_NAME }}.exe

- name: upload windows
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ env.FILE_NAME }}
path: ./target/release/${{ matrix.os }}-${{ env.FILE_NAME }}.exe
- uses: actions/upload-artifact@v4
if: matrix.os != 'windows-latest'
with:
name: ${{ matrix.os }}-flora_parsing
path: ./target/release/${{ matrix.os }}-${{ env.FILE_NAME }}

release:
needs: build
runs-on: ubuntu-latest
permissions: write-all
strategy:
fail-fast: false
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
- name: Display structure of downloaded files
run: ls -R
- uses: ncipollo/release-action@v1
with:
artifacts: './ubuntu-latest-flora_parsing/ubuntu-latest-flora_parsing,./macOS-latest-flora_parsing/macOS-latest-flora_parsing,./windows-latest-flora_parsing/windows-latest-flora_parsing.exe'
File renamed without changes.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ For now There is three mode availables:
- action_time: Calculate the sum of each actions occurence at each time for every group;
- total_action: Calculate the total elapsed time for each action for every group

Inputfile should be a valid MEP-PC .txt file.
Outputfile is an optionnal .txt file. Default to output.txt

0 comments on commit 5995e58

Please sign in to comment.