-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (148 loc) · 4.81 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
---
name: JupyterLab - Test and Build
on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- "*"
permissions: {} # yamllint disable-line
jobs:
yamllint:
name: YAML Lint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
id: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run yamllint
id: run_yamllint
uses: actionshub/yamllint@b772a30c3ba90c5f5aadfe94d8f3599e3a7099c8 # v1.8.2
markdownlint:
name: Markdown Lint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
id: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run mdl
id: run_mdl
uses: actionshub/markdownlint@6c82ff529253530dfbf75c37570876c52692835f # v3.1.4
build-and-test:
if: github.ref != 'main'
name: Build and Test
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
max-parallel: 3
matrix:
flavour:
- "allspark-notebook"
# - "datascience-notebook"
# - "oracle-datascience-notebook"
steps:
- name: Checkout
id: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build and Test
id: build_and_test
shell: bash
run: |
bash scripts/build-and-test.sh "${{ matrix.flavour }}"
# 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
# version: 4.3.2
# - name: Test
# working-directory: "./${{ matrix.flavour }}"
# env:
# CHEF_LICENSE: accept
# REGISTRY: ${{ steps.login-ecr.outputs.registry }}
# IMAGE_TAG: ${{ steps.prep.outputs.tag }}
# run: |
# inspec exec --chef-license=accept 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 }}