Skip to content

Commit

Permalink
test import
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <[email protected]>
  • Loading branch information
AustinAbro321 committed Aug 29, 2024
1 parent 9f442ce commit 17a9042
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/test-import.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test Import
on:
pull_request:
permissions:
contents: read
# Abort prior jobs in the same workflow / PR
concurrency:
group: import-${{ github.ref }}
cancel-in-progress: true
jobs:
test-import:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: 'go.mod'
cache: true

- name: Run test Go program that imports Zarf
run: |
cd ..
mkdir test-import
cd test-import
echo "$GO_MAIN" > main.go
go mod init github.com/zarf-dev/test-import
go mod edit -replace github.com/zarf-dev/zarf=../zarf
go mod tidy
go run main.go
env:
GO_MAIN: |
package main
import (
"fmt"
"github.com/zarf-dev/zarf/src/api/v1alpha1"
"github.com/zarf-dev/zarf/src/pkg/packager"
)
func main() {
fmt.Println(packager.Packager{})
fmt.Println(v1alpha1.ZarfComponent{})
}

0 comments on commit 17a9042

Please sign in to comment.