From de628dae37d6b09487d6f2d8726f86e1949632cf Mon Sep 17 00:00:00 2001 From: DeveloperC Date: Sat, 16 Sep 2023 10:40:54 +0100 Subject: [PATCH] style: changing target to compile-${arch} To keep the consistent format of `${verb}-...` used by all the other targets. --- .github/workflows/continuous-integration.yml | 17 ++++++++++++++--- Earthfile | 8 ++++---- README.md | 10 ++++++---- ci/{compiling.sh => compile.sh} | 0 4 files changed, 24 insertions(+), 11 deletions(-) rename ci/{compiling.sh => compile.sh} (100%) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 562192f..74a1161 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -79,15 +79,26 @@ jobs: uses: actions/checkout@v3 - name: Check module. run: earthly --ci +check-module-tidying - compiling: + compile-darwin-amd64: + name: Compile Darwin AMD64 runs-on: ubuntu-latest steps: - name: Download Earthly v0.7.17. run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.7.17/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'" - name: Checkout code. uses: actions/checkout@v3 - - name: Check compiling. - run: earthly --ci +compiling-linux-amd64 + - name: Compile Darwin AMD64. + run: earthly --ci +compile-darwin-amd64 + compile-linux-amd64: + name: Compile Linux AMD64 + runs-on: ubuntu-latest + steps: + - name: Download Earthly v0.7.17. + run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.7.17/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'" + - name: Checkout code. + uses: actions/checkout@v3 + - name: Compile Linux AMD64. + run: earthly --ci +compile-linux-amd64 unit-testing: runs-on: ubuntu-latest steps: diff --git a/Earthfile b/Earthfile index 7dea2d4..8bef238 100644 --- a/Earthfile +++ b/Earthfile @@ -183,20 +183,20 @@ fix-module-tidying: SAVE ARTIFACT "go.sum" AS LOCAL "go.sum" -compiling-linux-amd64: +compile-linux-amd64: FROM +golang-base DO +INSTALL_DEPENDENCIES DO +COPY_SOURCECODE - RUN ./ci/compiling.sh + RUN ./ci/compile.sh DO +SAVE_OUTPUT -compiling-darwin-amd64: +compile-darwin-amd64: FROM +golang-base ENV GOOS=darwin DO +INSTALL_DEPENDENCIES DO +COPY_SOURCECODE - RUN ./ci/compiling.sh + RUN ./ci/compile.sh DO +SAVE_OUTPUT diff --git a/README.md b/README.md index a6cc492..9791768 100644 --- a/README.md +++ b/README.md @@ -178,16 +178,18 @@ earthly +fix-module-tidying ``` #### Compiling -You can compile the source code into a binary by running the command. +You can compile the source code into a binary for an architecture by running the command. ```sh -earthly +compiling-linux-amd64 +earthly +compile-${architecture} ``` -or +The available architectures are `linux-amd64` and `darwin-amd64`. + +*E.g.* ```sh -earthly +compiling-darwin-amd64 +earthly +compile-linux-amd64 ``` #### Unit Testing diff --git a/ci/compiling.sh b/ci/compile.sh similarity index 100% rename from ci/compiling.sh rename to ci/compile.sh