From 0f8f95166c45606f8f5ffb1f71aea3006a3e759a Mon Sep 17 00:00:00 2001 From: Damien Date: Tue, 6 Aug 2024 20:16:45 +0200 Subject: [PATCH] Adding CI/CD --- .github/workflows/build.yml | 22 +++++++++++ .github/workflows/release.yml | 44 +++++++++++++++++++++ .github/workflows/release_macos.yml | 60 +++++++++++++++++++++++++++++ LICENCE => LICENSE | 0 README.md | 2 + 5 files changed, 128 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/release_macos.yml rename LICENCE => LICENSE (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..0f84b06 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..61cb2b2 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: Release + +on: + release: + types: [created] + +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 + - name: release + run: cargo build --release + + release: + name: release ${{ matrix.target }} + runs-on: ubuntu-latest + permissions: write-all + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-pc-windows-gnu + archive: zip + - target: x86_64-unknown-linux-musl + archive: tar.gz tar.xz tar.zst + steps: + - uses: actions/checkout@master + - name: Compile and release + uses: rust-build/rust-build.action@v1.4.5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + RUSTTARGET: ${{ matrix.target }} + ARCHIVE_TYPES: ${{ matrix.archive }} \ No newline at end of file diff --git a/.github/workflows/release_macos.yml b/.github/workflows/release_macos.yml new file mode 100644 index 0000000..bbe947f --- /dev/null +++ b/.github/workflows/release_macos.yml @@ -0,0 +1,60 @@ +name: ReleaseAll + + +on: + push: + tags: + - '*' +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + 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 --verbose --release + + - name: rename + if: matrix.os != 'windows-latest' + run: mv ./target/release/flora_parsing ./target/release/${{ matrix.os }}-flora_parsing + - name: rename windows + if: matrix.os == 'windows-latest' + run: mv ./target/release/flora_parsing.exe ./target/release/${{ matrix.os }}-flora_parsing.exe + + - name: upload windows + if: matrix.os == 'windows-latest' + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os }}-flora_parsing + path: ./target/release/${{ matrix.os }}-flora_parsing.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' \ No newline at end of file diff --git a/LICENCE b/LICENSE similarity index 100% rename from LICENCE rename to LICENSE diff --git a/README.md b/README.md index 848be69..d9e6347 100644 --- a/README.md +++ b/README.md @@ -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