Skip to content

run CI on push to ALL branches too (but only actually run if this i… #4710

run CI on push to ALL branches too (but only actually run if this i…

run CI on push to ALL branches too (but only actually run if this i… #4710

Workflow file for this run

name: Grid CI
on:
workflow_dispatch: # Manual invocation.
pull_request:
push:
jobs:
CI:
# only actually run if this is a pull_request from a fork OR push to an internal branch
if: github.event.pull_request.head.repo.fork || github.event_name != 'pull_request'
runs-on: ubuntu-latest
permissions:
# required by aws-actions/configure-aws-credentials
id-token: write
contents: read
pull-requests: write
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.16.2
# Wait for elasticsearch to report healthy before continuing.
# see https://github.com/actions/example-services/blob/master/.github/workflows/postgres-service.yml#L28
options: -e "discovery.type=single-node" --expose 9200 --health-cmd "curl localhost:9200/_cluster/health" --health-interval 10s --health-timeout 5s --health-retries 10
ports:
- 9200:9200
localstack:
image: localstack/localstack:0.11.0
env:
SERVICES: kinesis,dynamodb
DEFAULT_REGION: eu-west-1
KINESIS_ERROR_PROBABILITY: 0.0
PORT_WEB_UI: 5050
ports:
- 5050:5050
- 4566:4566
options: >-
--health-cmd "curl localhost:5050/health"
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Kahuna (client-side)
working-directory: ./kahuna
run: |
npm install-clean
npm run undist
npm test
npm run dist
- name: install image libs needed for tests
run: |
sudo apt-get -y update
sudo apt-get -y install graphicsmagick
sudo apt-get -y install graphicsmagick-imagemagick-compat
sudo apt-get -y install exiftool
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'corretto'
cache: 'sbt'
- name: SBT
env:
USE_DOCKER_FOR_TESTS: false # i.e. don't initialise the DockerContainer within tests, instead rely on the ones defined in the 'services' section of this file
run: sbt clean compile Test/compile test Debian/packageBin
- name: Image Counter Lambda
working-directory: ./image-counter-lambda
run: |
npm install-clean
npm test
npm run compile
- name: S3Watcher
working-directory: ./s3watcher/lambda
run: |
npm install-clean
npm test
npm run build
- uses: aws-actions/configure-aws-credentials@v4
if: "! github.event.pull_request.head.repo.fork"
with:
role-to-assume: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
aws-region: eu-west-1
- uses: guardian/[email protected]
if: "! github.event.pull_request.head.repo.fork"
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
commentingStage: TEST
projectName: media-service::grid::all
buildNumberOffset: 7565
configPath: riff-raff.yaml
contentDirectories: |
auth:
- auth/target/auth.deb
collections:
- collections/target/collections.deb
cropper:
- cropper/target/cropper.deb
image-loader-projection:
- image-loader/target/image-loader.deb
image-loader:
- image-loader/target/image-loader.deb
kahuna:
- kahuna/target/kahuna.deb
leases:
- leases/target/leases.deb
media-api:
- media-api/target/media-api.deb
metadata-editor:
- metadata-editor/target/metadata-editor.deb
thrall:
- thrall/target/thrall.deb
usage:
- usage/target/usage.deb
image-counter-lambda:
- image-counter-lambda/dist/image-counter-lambda.zip
s3watcher:
- s3watcher/lambda/target/s3watcher.zip