-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (87 loc) · 2.79 KB
/
draft-api_ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# AUTOGENERATED BY: project/GithubWorkflowPlugin.scala (sbt `ghGenerate`)
# DO NOT EDIT MANUALLY.
name: 'CI: draft-api'
on:
workflow_dispatch:
inputs: { }
push:
paths:
- draft-api/**
- project/draftapi*.scala
- network/**
- project/network*.scala
- mapping/**
- project/mapping*.scala
- language/**
- project/language*.scala
- validation/**
- project/validation*.scala
- common/**
- project/common*.scala
- search/**
- project/search*.scala
- database/**
- project/database*.scala
- scalatestsuite/**
- project/scalatestsuite*.scala
- tapirtesting/**
- project/tapirtesting*.scala
- project/Dependencies.scala
- project/Module.scala
pull_request:
paths:
- draft-api/**
- project/draftapi*.scala
- network/**
- project/network*.scala
- mapping/**
- project/mapping*.scala
- language/**
- project/language*.scala
- validation/**
- project/validation*.scala
- common/**
- project/common*.scala
- search/**
- project/search*.scala
- database/**
- project/database*.scala
- scalatestsuite/**
- project/scalatestsuite*.scala
- tapirtesting/**
- project/tapirtesting*.scala
- project/Dependencies.scala
- project/Module.scala
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_CLIENT_ID }}
AWS_DEFAULT_REGION: eu-west-1
AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_AWS_CLIENT_SECRET }}
NDLA_AWS_ECR_REPO: ${{ secrets.NDLA_AWS_ECR_REPO }}
CI_RELEASE_ROLE: ${{ secrets.CI_RELEASE_ROLE }}
CI_GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
NDLA_RELEASES: ${{ secrets.NDLA_RELEASES }}
COMPONENT: draft-api
jobs:
unit_tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: coursier/cache-action@v6
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: '20'
- name: Login to ECR repo
run: RES=$(aws sts assume-role --role-arn $CI_RELEASE_ROLE --role-session-name
github-actions-ecr-login) AWS_ACCESS_KEY_ID=$(echo $RES | jq -r .Credentials.AccessKeyId)
AWS_SECRET_ACCESS_KEY=$(echo $RES | jq -r .Credentials.SecretAccessKey) AWS_SESSION_TOKEN=$(echo
$RES | jq -r .Credentials.SessionToken) aws ecr get-login-password --region
eu-central-1 | docker login --username AWS --password-stdin $NDLA_AWS_ECR_REPO
- name: Login to dockerhub
run: echo $DOCKER_HUB_PASSWORD | docker login --username $DOCKER_HUB_USERNAME
--password-stdin
- name: Unit tests
run: sbt draft-api/test