Skip to content

fix: revert example dir, tests fail #1120

fix: revert example dir, tests fail

fix: revert example dir, tests fail #1120

Workflow file for this run

name: Build and Test
on:
push:
branches:
- "main"
- "mw-*"
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'
- '**/*.txt'
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Lint
run: ./lint.sh
build:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
component:
[
"wikibase",
"elasticsearch",
"wdqs",
"wdqs-frontend",
"wdqs-proxy",
"quickstatements",
]
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Build
run: ./build.sh --save-image --extract-tarball ${{ matrix.component }}
shell: bash
- name: Upload results
uses: ./.github/actions/upload-results
with:
component: ${{ matrix.component }}
- name: Scan Image
uses: ./.github/actions/scan-image
continue-on-error: true
with:
image_name: ${{ matrix.component }}
# TODO: remove extra step with https://phabricator.wikimedia.org/T347000
- name: Scan additional bundle Image for wikibase builds
if: matrix.component == 'wikibase'
uses: ./.github/actions/scan-image
continue-on-error: true
with:
image_name: "${{ matrix.component }}-bundle"
test:
strategy:
fail-fast: false
matrix:
suite:
[
repo,
fedprops,
repo_client,
quickstatements,
pingback,
confirm_edit,
elasticsearch,
base__repo,
base__repo_client,
base__pingback,
base__fedprops,
example
]
needs:
- build
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Get built Docker artifacts
uses: actions/download-artifact@v3
with:
name: DockerImages
path: artifacts/
- name: Test ${{ matrix.suite }}
run: ./test.sh ${{ matrix.suite }}
- name: Report Selenium
if: always()
run: |
cd .github/reporter
npm install
node report.js ${{ matrix.suite }}
- name: Show Logs
if: always()
continue-on-error: true
run: |
ls -lahr test/suites/${{ matrix.suite }}/results test/suites/${{ matrix.suite }}/results/*
tail -n +1 test/suites/${{ matrix.suite }}/results/*.log
- name: Archive Docker test artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: TestResults
path: test/suites/**/results
test_upgrade:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
# TODO: can we get this from the environment to not have it hardcoded in the pipeline code?
version: [
# Latest 1.37
'WMDE9',
'WMDE9_BUNDLE',
# Earlier 1.39
'WMDE11',
'WMDE11_BUNDLE',
# Latest 1.38
'WMDE12',
'WMDE12_BUNDLE'
]
needs:
- build
steps:
- uses: actions/checkout@v4
- name: Get built Docker artifacts
uses: actions/download-artifact@v3
with:
name: DockerImages
path: artifacts/
- name: Test upgrade from ${{ matrix.version }}
# This step should only take ~5 mins to complete, but sometimes seems to lock up and use the whole job timeout
# Set a specific lower timeout to allow us to retry sooner
timeout-minutes: 10
run: ./test.sh upgrade ${{ matrix.version }}
# TODO: DRY
- name: Archive Docker test artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: TestResults
path: test/suites/**/results
upload_ghcr:
runs-on: ubuntu-latest
timeout-minutes: 20
# we only upload builds to github container registry
# - from main branch builds
# - from release branch builds and
# - builds from PRs going to a release branch
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/mw-') || startsWith(github.base_ref, 'mw-')
needs:
- test
- test_upgrade
strategy:
fail-fast: false
matrix:
docker_image:
[
"wikibase/wikibase",
"wikibase/wikibase-bundle",
"wikibase/elasticsearch",
"wikibase/wdqs",
"wikibase/wdqs-frontend",
"wikibase/wdqs-proxy",
"wikibase/quickstatements",
]
steps:
- uses: actions/checkout@v4
- name: Get built Docker images
uses: actions/download-artifact@v3
with:
name: DockerImages
path: artifacts/
- name: Load docker images
shell: bash
run: |
for file in artifacts/*.docker.tar.gz; do
docker load -i "$file"
done
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Store built docker image on GHCR
uses: wmde/tag-push-ghcr-action@v3
with:
image_name: ${{ matrix.docker_image }}
tag: ${{ github.run_id }}