-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (105 loc) · 3.37 KB
/
jupyter-lab-test-and-build.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
---
name: JupyterLab - test and build
on:
pull_request:
push:
branches: [main]
tags: "*"
jobs:
yamllint:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@main
- name: Run yaml Lint
uses: actionshub/yamllint@main
mdl:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@main
- name: Run Markdown Lint
uses: actionshub/markdownlint@main
docker:
runs-on: [self-hosted, management-ecr]
strategy:
fail-fast: false
max-parallel: 3
matrix:
flavour:
- "allspark-notebook"
# - "datascience-notebook"
# - "oracle-datascience-notebook"
env:
REPOSITORY: ${{ matrix.flavour }}
ECR_REPOSITORY: ${{ matrix.flavour }}
needs: [mdl, yamllint]
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: eu-west-1
role-to-assume: arn:aws:iam::593291632749:role/github-actions-management-ecr
role-duration-seconds: 1200
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
registries: 593291632749
- name: Check out code
uses: actions/checkout@v2
- name: Prep Tags
id: prep
run: |
TAG=noop
if [[ $GITHUB_REF == refs/tags/* ]]; then
TAG=${GITHUB_REF#refs/tags/}
elif [[ $GITHUB_REF == refs/heads/* ]]; then
TAG=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
if [ "${{ github.event.repository.default_branch }}" = "$TAG" ]; then
TAG=edge
fi
elif [[ $GITHUB_REF == refs/pull/* ]]; then
TAG=pr-${{ github.event.number }}
elif [ "${{ github.event_name }}" = "push" ]; then
TAG="sha-${GITHUB_SHA::8}"
fi
echo "Docker image tag = '$TAG'"
echo ::set-output name=tag::${TAG}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Build image
working-directory: "./${{ matrix.flavour }}"
run: make build
env:
NETWORK: host
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ steps.prep.outputs.tag }}
- name: Install InSpec
uses: actionshub/chef-install@main
with:
channel: current
project: inspec
- name: Test
working-directory: "./${{ matrix.flavour }}"
run: |
inspec exec tests -t "docker://${REGISTRY}/${REPOSITORY}:${IMAGE_TAG}"
# - name: Test
# working-directory: "./${{ matrix.flavour }}"
# run: make test
# env:
# NETWORK: host
# REGISTRY: ${{ steps.login-ecr.outputs.registry }}
# IMAGE_TAG: ${{ steps.prep.outputs.tag }}
# - name: Push image
# working-directory: "./${{ matrix.flavour }}"
# run: make push
# env:
# REGISTRY: ${{ steps.login-ecr.outputs.registry }}
# IMAGE_TAG: ${{ steps.prep.outputs.tag }}
# - name: Cleanup
# if: ${{ always() }}
# working-directory: "./${{ matrix.flavour }}"
# run: make clean
# env:
# REGISTRY: ${{ steps.login-ecr.outputs.registry }}
# IMAGE_TAG: ${{ steps.prep.outputs.tag }}