From b9cc3c88bc276210b50f644ec5f940ffa19d54f3 Mon Sep 17 00:00:00 2001 From: Enri Ozuni Date: Sun, 24 Oct 2021 20:00:38 +0200 Subject: [PATCH 1/2] Create main workflow with GitHub Actions CI Signed-off-by: Enri Ozuni --- .github/workflows/main_build.yml | 126 +++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 .github/workflows/main_build.yml diff --git a/.github/workflows/main_build.yml b/.github/workflows/main_build.yml new file mode 100644 index 000000000..2fe6956d4 --- /dev/null +++ b/.github/workflows/main_build.yml @@ -0,0 +1,126 @@ +name: CogniCrypt build + +on: [push, pull_request] + +jobs: + + # Builds the project in Windows + windows-build: + # Runs on Windows + runs-on: windows-latest + name: Project build in Windows + steps: + # Downloads CogniCrypt repository + - name: Checkout source code + uses: actions/checkout@v2 + # Sets up Java version + - name: Set up Java + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-package: jdk + java-version: '8' + # Sets up Maven version + - name: Set up Maven + uses: stCarolas/setup-maven@v4.2 + with: + maven-version: 3.6.3 + # Checks Java version + - name: Check Java version + run: java -version + # Checks Maven version + - name: Check Maven version + run: mvn -version + # Restores Maven dependecies + - name: Restore local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + # Compiles, tests, and packages the CogniCrypt project + - name: Compile, test, and package the project + run: mvn -B clean install -DskipTests=true -U + + + + # Builds the project in Ubuntu + ubuntu-build: + # Runs on Ubuntu + runs-on: ubuntu-latest + name: Project build in Ubuntu + steps: + # Downloads CogniCrypt repository + - name: Checkout source code + uses: actions/checkout@v2 + # Sets up Java version + - name: Set up Java + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-package: jdk + java-version: '8' + # Sets up Maven version + - name: Set up Maven + uses: stCarolas/setup-maven@v4.2 + with: + maven-version: 3.6.3 + # Checks Java version + - name: Check Java version + run: java -version + # Checks Maven version + - name: Check Maven version + run: mvn -version + # Restores Maven dependecies + - name: Restore local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + # Compiles, tests, and packages the CogniCrypt project + - name: Compile, test, and package the project + run: mvn -B clean install -DskipTests=true -U + + + + # Builds the project in macOS + macos-build: + # Runs on macOS + runs-on: macos-latest + name: Project build in macOS + steps: + # Downloads CogniCrypt repository + - name: Checkout source code + uses: actions/checkout@v2 + # Sets up Java version + - name: Set up Java + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-package: jdk + java-version: '8' + # Sets up Maven version + - name: Set up Maven + uses: stCarolas/setup-maven@v4.2 + with: + maven-version: 3.6.3 + # Checks Java version + - name: Check Java version + run: java -version + # Checks Maven version + - name: Check Maven version + run: mvn -version + # Restores Maven dependecies + - name: Restore local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + # Compiles, tests, and packages the CogniCrypt project + - name: Compile, test, and package the project + run: mvn -B clean install -DskipTests=true -U From 0404364302732786b3c244badfc241bb097a04e3 Mon Sep 17 00:00:00 2001 From: Enri Ozuni Date: Fri, 29 Oct 2021 08:31:10 +0200 Subject: [PATCH 2/2] Add docs in GitHub Actions YAML --- .github/workflows/main_build.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/main_build.yml b/.github/workflows/main_build.yml index 2fe6956d4..1c69039be 100644 --- a/.github/workflows/main_build.yml +++ b/.github/workflows/main_build.yml @@ -124,3 +124,13 @@ jobs: # Compiles, tests, and packages the CogniCrypt project - name: Compile, test, and package the project run: mvn -B clean install -DskipTests=true -U + + +# REFERENCES + +# The following link is a short guide for learning GitHub Actions: +# https://docs.github.com/en/actions/learn-github-actions + +# We are using Gitub-hosted runners or servers that build our project. +# Up-to-date details about runners and their versions can be found under: +# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners