Skip to content

Commit 4d8c831

Browse files
starpitaavarghese
authored andcommitted
test: fix github actions
Signed-off-by: Nick Mitchell <[email protected]>
1 parent 2f2fb38 commit 4d8c831

File tree

9 files changed

+28
-34
lines changed

9 files changed

+28
-34
lines changed

.github/workflows/actions.yml

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Kind
1+
name: CI Tests
22

33
# cancel any prior runs for this workflow and this PR (or branch)
44
concurrency:
@@ -12,15 +12,16 @@ on:
1212
branches: [ main ]
1313

1414
jobs:
15-
testsh:
15+
ci:
1616
runs-on: ${{ matrix.os }}
1717

1818
strategy:
1919
matrix:
20-
ARGS:
21-
- "-e 'test(7.*|8.*)'" # baseline tests
22-
- "-i 'test7.*' -e 'test8.*'" # including only test7* tests (simpler tests)
23-
- "-i 'test8.*' -e 'test7.*'" # including only test8* tests (application tests)
20+
SCRIPT:
21+
- ./tests/bin/ci.sh -e 'test(7.*|8.*)' # baseline tests
22+
- ./tests/bin/ci.sh -i 'test7.*' -e 'test8.*' # including only test7* tests (simpler tests)
23+
- ./tests/bin/ci.sh -i 'test8.*' -e 'test7.*' # including only test8* tests (application tests)
24+
- ./tests/bin/go.sh
2425
os: [ubuntu-latest]
2526

2627
steps:
@@ -34,22 +35,10 @@ jobs:
3435
- name: Setup
3536
run: ./tests/bin/travis/setup.sh
3637

37-
- name: Run Test with args ${{ matrix.ARGS }}
38-
run: bash -c "./tests/bin/ci.sh ${{matrix.ARGS }}"
39-
40-
gosh:
41-
runs-on: ${{ matrix.os }}
42-
43-
steps:
44-
- uses: actions/checkout@v4
38+
- name: Check Docker
39+
run: docker version && podman version
4540

46-
- name: Create k8s Kind Cluster
47-
uses: helm/[email protected]
48-
with:
49-
install_only: true
50-
51-
- name: Setup
52-
run: ./tests/bin/travis/setup.sh
53-
54-
- name: Run Go Tests
55-
run: ./tests/bin/go.sh
41+
- name: Run Test with args ${{ matrix.ARGS }}
42+
env:
43+
TERM: xterm-256color
44+
run: bash -c "${{matrix.SCRIPT}} ${{matrix.ARGS }}"

charts/.helmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
.helmignore
66
.DS_Store
77
.cache
8+
LICENSE
89

910
# these will all be pulled in from Chart.yaml as dependencies
1011
/core

pkg/fe/assembler/stage.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ func copyAppIntoTemplate(appname, sourcePath, templatePath, branch string, verbo
3434
fmt.Fprintf(os.Stderr, "Copying app templates into %s\n", appdir)
3535
}
3636

37-
if strings.HasPrefix(sourcePath, "git@") {
38-
if os.Getenv("CI") != "" && os.Getenv("AI_FOUNDATION_GITHUB_USER") != "" {
37+
isGitSsh := strings.HasPrefix(sourcePath, "git@")
38+
isGitHttp := !isGitSsh && strings.HasPrefix(sourcePath, "https:")
39+
if isGitSsh || isGitHttp {
40+
if isGitSsh && os.Getenv("CI") != "" && os.Getenv("AI_FOUNDATION_GITHUB_USER") != "" {
3941
// [email protected]:user/repo.git -> https://patuser:[email protected]/user/repo.git
4042
pattern := regexp.MustCompile("^git@([^:]+):([^/]+)/([^.]+)[.]git$")
4143
// apphttps := $(echo $appgit | sed -E "s#^git\@([^:]+):([^/]+)/([^.]+)[.]git\$#https://${AI_FOUNDATION_GITHUB_USER}:${AI_FOUNDATION_GITHUB_PAT}@\1/\2/\3.git#")

pkg/lunchpail/images/build/podman.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ const (
1313
)
1414

1515
func WhichContainerCli() (ContainerCli, error) {
16-
if which.Found("podman") {
17-
return "podman", nil
18-
} else if which.Found("docker") {
16+
if which.Found("docker") {
1917
return "docker", nil
18+
} else if which.Found("podman") {
19+
return "podman", nil
2020
} else {
2121
return "", fmt.Errorf("No container CLI found")
2222
}

tests/bin/deploy-tests.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,15 @@ testapp="$TARGET"/test
6161
# Allows us to capture workstealer info before it auto-terminates
6262
export LP_SLEEP_BEFORE_EXIT=10
6363

64+
repo_secret="" # e.g. user:pat@https://github.mycompany.com
65+
6466
# intentionally setting some critical values at assemble time to the
6567
# final value, and some critical values to bogus values that are then
6668
# overridden by final values at shrinkwrap time
6769
/tmp/lunchpail assemble -v \
6870
-o $testapp \
6971
$branch \
70-
--repo-secret $AI_FOUNDATION_GITHUB_USER:$AI_FOUNDATION_GITHUB_PAT@https://github.ibm.com \
72+
$repo_secret \
7173
$2
7274

7375
$testapp up \

tests/tests/test7f-external/settings.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
api=workqueue
2-
app=git@github.ibm.com:cloud-computer/lunchpail-demo.git
2+
app=https://github.com/IBM/lunchpail-demo.git
33
branch=v0.0.15
44
deployname=lunchpail-demo
55

tests/tests/test7f-repo/pail/app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
spec:
66
api: workqueue
77
role: worker
8-
repo: https://github.ibm.com/cloud-computer/lunchpail/tree/main/tests/tests/test7f-repo/pail
8+
repo: https://github.com/IBM/lunchpail/tree/main/tests/tests/test7f-repo/pail
99
command: ./src/main.sh
1010
image: {{ print .Values.global.image.registry "/" .Values.global.image.repo "/worker-alpine:" .Chart.AppVersion }}
1111
env:

tests/tests/test8/settings.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
api=workqueue
2-
app=git@github.ibm.com:mceda/lunchpail-openroad-max-utilization.git
2+
app=https://github.com/IBM/lunchpail-openroad-max-utilization.git
33
branch=v0.1.0
44
deployname=lunchpail-openroad-max-utilization
55

tests/tests/test8b/settings.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
api=workqueue
2-
app=git@github.ibm.com:mceda/lunchpail-openroad-max-utilization.git
2+
app=https://github.com/IBM/lunchpail-openroad-max-utilization.git
33
branch=v0.1.0
44
deployname=lunchpail-openroad-max-utilization
55

0 commit comments

Comments
 (0)