Skip to content

Commit

Permalink
ci: check releases
Browse files Browse the repository at this point in the history
  • Loading branch information
fpaul-1A committed Sep 16, 2024
1 parent dc027b9 commit 1d93902
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 4 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/check-all-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Check all releases (latest patch of each minor version)

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 6"

permissions:
contents: read
issues: write

env:
YARN_ENABLE_HARDENED_MODE: 0

jobs:
findTags:
runs-on: ubuntu-latest
outputs:
tags: ${{ steps.getTags.outputs.TAGS }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
fetch-tags: true
- name: Get the latest patch of each minor version
run: |
TAGS=$(git tag -l | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | awk -F. '{print $1"."$2}' | uniq | xargs -I {} sh -c 'git tag -l "{}.*" | sort -V | tail -n 1' | xargs -d'\n' -I {} echo '"{}"' | tr '\n' ',')
echo "TAGS=[$TAGS]" >> "$GITHUB_OUTPUT"
id: getTags

checkRelease:
needs: findTags
strategy:
fail-fast: false
matrix:
#tag: ${{ fromJSON(needs.findTags.outputs.tags) }}
tag: [v10.4.9, v11.0.6]
uses: ./.github/workflows/check-release.yml
with:
ref: ${{ matrix.tag }}

report:
runs-on: ubuntu-latest
needs: checkRelease
if: failure()
steps:
- run: echo TODO create issue
46 changes: 46 additions & 0 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Check release

on:
workflow_dispatch:
inputs:
ref:
type: string
required: true
description: The branch, tag or SHA to checkout.
workflow_call:
inputs:
ref:
type: string
default: ''
description: The branch, tag or SHA to checkout.
secrets:
NX_CLOUD_ACCESS_TOKEN:
required: false
description: Token to use Nx Cloud token

env:
YARN_ENABLE_HARDENED_MODE: 0

jobs:
buildRelease:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ inputs.ref }}
- uses: ./tools/github-actions/setup
- uses: ./.github/actions/setup-java
with:
install-jdk: 'true'
- run: yarn build:swagger-gen
- run: yarn build
- uses: ./tools/github-actions/upload-build-output
with:
artifactName: 'dist-${{ inputs.ref }}'

testRelease:
needs: [buildRelease]
uses: ./.github/workflows/it-tests.yml
with:
ref: ${{ inputs.ref }}
skipNxCache: true
21 changes: 17 additions & 4 deletions .github/workflows/it-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
default: false
required: false
description: Skip the nx cache
ref:
type: string
default: ''
description: The branch, tag or SHA to checkout.
secrets:
NX_CLOUD_ACCESS_TOKEN:
required: false
Expand All @@ -27,7 +31,11 @@ jobs:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ inputs.ref }}
- uses: ./tools/github-actions/download-build-output
with:
artifactName: ${{ inputs.ref && format('dist-{0}', inputs.ref) || 'dist' }}
- uses: ./tools/github-actions/setup
- name: Setup verdaccio once for all tests
id: setup-verdaccio
Expand All @@ -43,7 +51,7 @@ jobs:
- name: Publish verdaccio storage
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: verdaccio
name: ${{ inputs.ref && format('verdaccio-{0}', inputs.ref) || 'verdaccio' }}
path: verdaccio.zip
- name: Stop verdaccio
if: always()
Expand All @@ -64,7 +72,11 @@ jobs:
PREPARE_TEST_ENV_TYPE: ${{ matrix.testEnvironment }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ inputs.ref }}
- uses: ./tools/github-actions/download-build-output
with:
artifactName: ${{ inputs.ref && format('dist-{0}', inputs.ref) || 'dist' }}
- uses: ./tools/github-actions/setup
- shell: bash
run: |
Expand All @@ -77,6 +89,7 @@ jobs:
run: echo "currentMonth=$(date +'%Y-%m')" >> $GITHUB_ENV
shell: bash
- name: Cache test-app yarn
if: inputs.ref == ''
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
Expand All @@ -89,7 +102,7 @@ jobs:
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
name: Download verdaccio storage prepared in the previous job
with:
name: verdaccio
name: ${{ inputs.ref && format('verdaccio-{0}', inputs.ref) || 'verdaccio' }}
path: '.'
- name: Setup verdaccio once for all tests
id: setup-verdaccio
Expand Down Expand Up @@ -122,13 +135,13 @@ jobs:
if: failure() && steps.it-tests.conclusion == 'failure'
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: it-tests-${{ matrix.os }}-${{ matrix.packageManager }}
name: it-tests-${{ matrix.os }}-${{ matrix.packageManager }}-${{ inputs.ref }}
path: it-tests.zip
- name: Publish tests reports
if: always()
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: it-reports-${{ matrix.os }}-${{ matrix.packageManager }}
name: it-reports-${{ matrix.os }}-${{ matrix.packageManager }}-${{ inputs.ref }}
path: 'packages/**/dist-test/it-report.xml'
- name: Stop verdaccio
if: always() && runner.os == 'Linux'
Expand Down

0 comments on commit 1d93902

Please sign in to comment.