From 463bc1b856d49c95b46c4c14f9d07727b1ac87a8 Mon Sep 17 00:00:00 2001 From: Alessandro Giugno Date: Wed, 24 Jan 2024 15:18:18 +0000 Subject: [PATCH] build(workflows): test.yaml is included in containerize --- .github/workflows/containerize.yml | 25 +++++-------- .github/workflows/test.yml | 57 ------------------------------ 2 files changed, 8 insertions(+), 74 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/containerize.yml b/.github/workflows/containerize.yml index 251ac21d..af192030 100644 --- a/.github/workflows/containerize.yml +++ b/.github/workflows/containerize.yml @@ -11,13 +11,12 @@ on: - Dockerfile workflow_dispatch: -# This should be consistent in the whole workflow env: - # Maybe use https://stackoverflow.com/questions/67288526/github-actions-replace-character-in-string - # or https://github.com/orgs/community/discussions/45488 YGGDRASIL_VERSION: 0.0.0 jobs: + # https://stackoverflow.com/questions/67288526/github-actions-replace-character-in-string + # https://github.com/orgs/community/discussions/45488 set-vars: runs-on: ubuntu-latest outputs: @@ -26,21 +25,10 @@ jobs: - name: set values id: gen_version run: | - echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT - - name: character-replacement-test - run: | - REPO=$GITHUB_REPOSITORY - DB_NAME="${REPO//-/_}" - echo $DB_NAME - - name: Use the value - # this sets environment variables for this step - env: - VERSION: ${{ steps.gen_version.outputs.VERSION }} - run: | - echo "${VERSION}" - + echo "VERSION=${GITHUB_REF_NAME////_}" >> $GITHUB_OUTPUT build-and-test: + needs: [set-vars] runs-on: ubuntu-latest defaults: run: @@ -51,6 +39,7 @@ jobs: # Tell scripts assume an non-interactive shell. This keeps logs clean # in case of e.g. progress bars that would cause one line for each state, otherwise TERM: dumb + YGGDRASIL_VERSION: "${{ needs.set-vars.outputs.VERSION }}" ports: - "8899:8080" steps: @@ -89,12 +78,14 @@ jobs: if-no-files-found: error containerize: - needs: build-and-test + needs: [set-vars, build-and-test] environment: "containerized_debugging" runs-on: ubuntu-latest defaults: run: shell: bash + env: + YGGDRASIL_VERSION: "${{ needs.set-vars.outputs.VERSION }}" steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index a545b768..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Run tests - -on: - push: - branches-ignore: - - main - paths-ignore: - - CHANGELOG.md - - README.md - - CONTRIBUTING.md - - LICENSE - - renovate.json - - ".github/workflows/**" - - docker-compose.yml - - Dockerfile - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-22.04 - env: - TERM: dumb - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Setup Java version 21 - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 21 - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - - name: Run checks and tests - run: ./gradlew check - - name: Upload analysis to GitHub - uses: actions/upload-artifact@v3 - if: always() - with: - name: check-results - path: | - yggdrasil-cartago/build/reports - yggdrasil-core/build/reports - yggdrasil-utils/build/reports - yggdrasil-websub/build/reports - build/reports - if-no-files-found: error - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml - fail_ci_if_error: true - flags: unittests - name: codecov-umbrella - verbose: true