Skip to content

Commit

Permalink
test: fix github actions
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Mitchell <nickm@us.ibm.com>
  • Loading branch information
starpit committed Jul 17, 2024
1 parent 2f2fb38 commit 3d6d8c4
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 32 deletions.
37 changes: 13 additions & 24 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Kind
name: CI Tests

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

jobs:
testsh:
ci:
runs-on: ${{ matrix.os }}

strategy:
matrix:
ARGS:
- "-e 'test(7.*|8.*)'" # baseline tests
- "-i 'test7.*' -e 'test8.*'" # including only test7* tests (simpler tests)
- "-i 'test8.*' -e 'test7.*'" # including only test8* tests (application tests)
SCRIPT:
- ./tests/bin/ci.sh -e 'test(7.*|8.*)' # baseline tests
- ./tests/bin/ci.sh -i 'test7.*' -e 'test8.*' # including only test7* tests (simpler tests)
- ./tests/bin/ci.sh -i 'test8.*' -e 'test7.*' # including only test8* tests (application tests)
- ./tests/bin/go.sh
os: [ubuntu-latest]

steps:
Expand All @@ -34,22 +35,10 @@ jobs:
- name: Setup
run: ./tests/bin/travis/setup.sh

- name: Run Test with args ${{ matrix.ARGS }}
run: bash -c "./tests/bin/ci.sh ${{matrix.ARGS }}"

gosh:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- name: Check Docker
run: docker version && podman version

- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.10.0
with:
install_only: true

- name: Setup
run: ./tests/bin/travis/setup.sh

- name: Run Go Tests
run: ./tests/bin/go.sh
- name: Run Test with args ${{ matrix.ARGS }}
env:
TERM: xterm-256color
run: bash -c "${{matrix.SCRIPT}} ${{matrix.ARGS }}"
6 changes: 4 additions & 2 deletions pkg/fe/assembler/stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ func copyAppIntoTemplate(appname, sourcePath, templatePath, branch string, verbo
fmt.Fprintf(os.Stderr, "Copying app templates into %s\n", appdir)
}

if strings.HasPrefix(sourcePath, "git@") {
if os.Getenv("CI") != "" && os.Getenv("AI_FOUNDATION_GITHUB_USER") != "" {
isGitSsh := strings.HasPrefix(sourcePath, "git@")
isGitHttp := !isGitSsh && strings.HasPrefix(sourcePath, "https@")
if isGitSsh || isGitHttp {
if isGitSsh && os.Getenv("CI") != "" && os.Getenv("AI_FOUNDATION_GITHUB_USER") != "" {
// git@github.ibm.com:user/repo.git -> https://patuser:pat@github.ibm.com/user/repo.git
pattern := regexp.MustCompile("^git@([^:]+):([^/]+)/([^.]+)[.]git$")
// apphttps := $(echo $appgit | sed -E "s#^git\@([^:]+):([^/]+)/([^.]+)[.]git\$#https://${AI_FOUNDATION_GITHUB_USER}:${AI_FOUNDATION_GITHUB_PAT}@\1/\2/\3.git#")
Expand Down
6 changes: 3 additions & 3 deletions pkg/lunchpail/images/build/podman.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const (
)

func WhichContainerCli() (ContainerCli, error) {
if which.Found("podman") {
return "podman", nil
} else if which.Found("docker") {
if which.Found("docker") {
return "docker", nil
} else if which.Found("podman") {
return "podman", nil
} else {
return "", fmt.Errorf("No container CLI found")
}
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test7f-external/settings.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
api=workqueue
app=git@github.ibm.com:cloud-computer/lunchpail-demo.git
app=https://github.com/IBM/lunchpail-demo.git
branch=v0.0.15
deployname=lunchpail-demo

Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test8/settings.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
api=workqueue
app=git@github.ibm.com:mceda/lunchpail-openroad-max-utilization.git
app=https://github.com/IBM/lunchpail-openroad-max-utilization.git
branch=v0.1.0
deployname=lunchpail-openroad-max-utilization

Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test8b/settings.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
api=workqueue
app=git@github.ibm.com:mceda/lunchpail-openroad-max-utilization.git
app=https://github.com/IBM/lunchpail-openroad-max-utilization.git
branch=v0.1.0
deployname=lunchpail-openroad-max-utilization

Expand Down

0 comments on commit 3d6d8c4

Please sign in to comment.