core!: implement iterators #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
pull_request: | |
branches: | |
- main | |
jobs: | |
govulncheck: | |
runs-on: ubuntu-latest | |
name: Security - govulncheck | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21' | |
- name: Install govulncheck | |
run: go install golang.org/x/vuln/cmd/govulncheck@v1.0.1 | |
- name: Run govulncheck | |
run: govulncheck ./... | |
build: | |
needs: govulncheck | |
strategy: | |
matrix: | |
os: [ 'ubuntu-latest', 'windows-latest' ] | |
go: [ '1.21' ] | |
arch: [ 'amd64', 'arm64', '386' ] | |
runs-on: ${{ matrix.os }} | |
name: Test and Build go${{ matrix.go }}_${{ matrix.os }}_${{ matrix.arch }} | |
env: | |
GOARCH: ${{ matrix.arch }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Go ${{ matrix.go }} | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Install Staticcheck | |
run: go install honnef.co/go/tools/cmd/staticcheck@2023.1.6 | |
if: ${{ (matrix.go == '1.21') }} | |
- name: Test | |
run: make test | |
# TODO: Add arm64 tests using docker | |
if: ${{ matrix.arch == 'amd64' }} | |
- name: Build CLI | |
run: | | |
make build-cli | |
out=gad_go${{ matrix.go }}_$(go env GOOS)_$(go env GOARCH) | |
echo "artifactPath=$out" >> "$GITHUB_ENV" | |
mv gad $out || true | |
mv gad.exe $out.exe || true | |
- name: 'Upload Artifact' | |
uses: actions/upload-artifact@v3 | |
if: ${{ matrix.go == '1.21' }} | |
with: | |
name: ${{ env.artifactPath }} | |
path: ${{ env.artifactPath }}* | |
if-no-files-found: error | |
retention-days: 7 | |
- name: Generate | |
run: make generate-all | |
if: ${{ matrix.arch == 'amd64' }} |