(ARM64) ACS Packaging CI #562
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: (ARM64) ACS Packaging CI | |
on: | |
schedule: | |
- cron: "0 3 * * 1-5" | |
workflow_dispatch: | |
env: | |
GITHUB_ACTIONS_DEPLOY_TIMEOUT: 60 | |
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} | |
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }} | |
TAS_ENVIRONMENT: ./tests/environment | |
TAS_SCRIPTS: ../alfresco-community-repo/packaging/tests/scripts | |
AWS_REGION: eu-west-1 | |
DTAS_VERSION: v1.5.5 | |
jobs: | |
arm64_health_check: | |
name: "ARM64 Health Check" | |
runs-on: ubuntu-latest-arm64-small | |
outputs: | |
test_failure: ${{ steps.persist_test_failure_flag.outputs.test_failure }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v7.0.0 | |
- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v7.0.0 | |
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v7.0.0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
- name: "Login to Docker Hub" | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: "Login to Quay.io" | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
- name: "Get latest matching tag" | |
run: | | |
VERSION_NUMBER=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+).*/\1/') | |
TEST_GIT_TAG=$(git tag --list --sort=-taggerdate "$VERSION_NUMBER*" | head -n 1) | |
if [ -z $TEST_GIT_TAG ]; then | |
TEST_GIT_TAG=$(git tag --list --sort=-taggerdate | head -n 1) | |
fi | |
echo "TEST_GIT_TAG=$TEST_GIT_TAG" >> $GITHUB_ENV | |
- name: "Prepare test config" | |
run: | | |
git checkout $TEST_GIT_TAG | |
mvn clean install -B -ntp -DskipTests -f tests/pipeline-all-amps/repo/pom.xml | |
cat tests/pipeline-all-amps/repo/target/dtas/dtas-config.json | |
- name: "Set up the environment" | |
id: setup-env | |
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} | |
env: | |
AWS_ACCESS_KEY: ${{ secrets.AWS_S3_PIPELINE_AMPS_ACCESS_KEY_ID }} | |
AWS_SECRET_KEY: ${{ secrets.AWS_S3_PIPELINE_AMPS_SECRET_ACCESS_KEY }} | |
run: | | |
# Make necessary env files available | |
git clone --depth=1 --branch master https://${{ secrets.BOT_GITHUB_USERNAME }}:${{ secrets.BOT_GITHUB_TOKEN }}@github.com/Alfresco/alfresco-community-repo.git ../alfresco-community-repo | |
# Start the environment | |
export PIPELINE_ALL_AMPS_REGISTRY=quay.io/ | |
export PIPELINE_ALL_AMPS_TAG=$TEST_GIT_TAG | |
${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-pipeline-all-amps.yml | |
${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8080/alfresco/" 180 | |
docker ps | |
curl -v --user admin.pipeline@alfresco.com:admin http://localhost:8080/alfresco/api/discovery | |
- name: "Run tests" | |
id: run-tests | |
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} | |
run: | | |
# Make necessary test files available | |
git clone --depth 1 --branch $DTAS_VERSION https://${{ secrets.BOT_GITHUB_USERNAME }}:${{ secrets.BOT_GITHUB_TOKEN }}@github.com/Alfresco/alfresco-deployment-test-automation-scripts.git dtas | |
cd dtas | |
python3 -m venv .venv | |
source .venv/bin/activate | |
python3 -m pip install -r requirements.txt | |
python3 -m pytest --configuration ../tests/pipeline-all-amps/repo/target/dtas/dtas-config.json tests/ -s | |
- name: "Dump all Docker containers logs" | |
if: failure() && (steps.setup-env.outcome == 'failure' || steps.run-tests.outcome == 'failure') | |
uses: Alfresco/alfresco-build-tools/.github/actions/docker-dump-containers-logs@v7.0.0 | |
- name: "Persist test failure flag" | |
id: persist_test_failure_flag | |
if: failure() | |
run: echo "test_failure=true" >> "$GITHUB_OUTPUT" | |
jira_integration: | |
name: "JIRA integration" | |
runs-on: ubuntu-latest | |
needs: | |
- arm64_health_check | |
if: always() | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
- name: "Run the JIRA Integration script" | |
run: | | |
pip install -r ./scripts/ci/jira/requirements.txt | |
./scripts/ci/jira/jira_integration.py | |
env: | |
BUILD_WEB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }} | |
JOB_NAME: arm64_health_check | |
TEST_FAILURE: ${{ needs.arm64_health_check.outputs.test_failure }} |