diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e490003..a47ef54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: runs-on: "ubuntu-latest" if: "${{ needs.check-basics.outputs.continue == '1' }}" container: - image: "ghcr.io/epitech/coding-style-checker:latest" + image: "epitechcontent/epitest-docker:latest" steps: - name: "Checkout" uses: "actions/checkout@v4.1.1" @@ -94,6 +94,11 @@ jobs: - name: "Clean up" run: "make fclean" + coding-style: + runs-on: "ubuntu-latest" + container: + image: "ghcr.io/epitech/coding-style-checker:latest" + steps: - name: "Check coding style" run: "/usr/local/bin/check.sh $(pwd) $(pwd)" @@ -115,6 +120,7 @@ jobs: run-tests: needs: - "basics" + - "coding-style" runs-on: "ubuntu-latest" container: image: "epitechcontent/epitest-docker:latest" @@ -132,6 +138,7 @@ jobs: uses: "Ximaz/valgrind-action@v1.2.0" with: binary_path: "./${{ env.UNIT_TESTS }}" + valgrind_suppressions: "${{ env.VALGRIND_SUPPRESSIONS }}" check-mirror-commits: runs-on: "ubuntu-latest" diff --git a/README.md b/README.md index 55752d3..7c5eaf7 100644 --- a/README.md +++ b/README.md @@ -16,24 +16,12 @@ branches. ## Clone this repository -To setup the workflow, you first need to clone this repository. You can use - -```bash -git clone git@github.com:Ximaz/epitech-ci-cd -``` - -Then you will have to change the origin URL. To do so, you can type the -following command : - +To setup the workflow, you first need to clone this repository. You can copy +that one-line bash script, it will setup everyting for you : ```bash -cd -# This must be YOUR repository, not the Epitech repository. -git remote set-url origin git@github.com:/ +curl -sSL https://raw.githubusercontent.com/Ximaz/epitech-ci-cd/main/setup.bash | bash ``` -Finally, you can remove the `README.md` file because it's the documentation -about this project, not your project's one. - ## Repository's Variables ### ARTIFACTS diff --git a/setup.bash b/setup.bash new file mode 100644 index 0000000..d5c89b6 --- /dev/null +++ b/setup.bash @@ -0,0 +1,29 @@ +#:/bin/bash -e + +get_variable() +{ + local DEFAULT="${1}" + local VARIABLE_NAME="${2}" + + [[ "${DEFAULT}" == "" ]] && read DEFAULT -p "Specify the ${VARIABLE_NAME}: " + echo "${DEFAULT}" +} + +main() +{ + local PROJECT_NAME=$(get_variable "${CICD_PROJECT_NAME}" "project's name") + local REPOSITORY=$(get_variable "${CICD_REPOSITORY}" "repository's url") + + [[ "${PROJECT_NAME}" != "" && "${REPOSITORY}" != "" ]] \ + && git clone "git@github.com:Ximaz/epitech-ci-cd" "${PROJECT_NAME}" \ + && cd "${PROJECT_NAME}" \ + && rm -rf .git README.md setup.bash \ + && git init . \ + && git branch -M main \ + && git remote add origin "${REPOSITORY}" \ + && git add .github .gitignore + unset -f get_variable + unset -f main +} + +main