|
| 1 | +name: Push |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +env: |
| 9 | + GOVERSION: "1.16" |
| 10 | + |
| 11 | +jobs: |
| 12 | + gen-diff: |
| 13 | + name: Codegen Diff |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v2 |
| 17 | + - uses: actions/setup-go@v2 |
| 18 | + with: |
| 19 | + go-version: ${{ env.GOVERSION }} |
| 20 | + - uses: actions/cache@v2 |
| 21 | + with: |
| 22 | + path: | |
| 23 | + ~/go/pkg/mod |
| 24 | + ~/.cache/go-build |
| 25 | + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
| 26 | + restore-keys: ${{ runner.os }}-go- |
| 27 | + - run: make generate man |
| 28 | + - run: git diff --exit-code |
| 29 | + |
| 30 | + lint: |
| 31 | + name: Lint |
| 32 | + needs: gen-diff |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v2 |
| 36 | + - uses: actions/setup-go@v2 |
| 37 | + with: |
| 38 | + go-version: ${{ env.GOVERSION }} |
| 39 | + - uses: golangci/golangci-lint-action@v2 |
| 40 | + |
| 41 | + test: |
| 42 | + name: Test |
| 43 | + needs: lint |
| 44 | + runs-on: ubuntu-latest |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v2 |
| 47 | + - uses: actions/setup-go@v2 |
| 48 | + with: |
| 49 | + go-version: ${{ env.GOVERSION }} |
| 50 | + - uses: actions/cache@v2 |
| 51 | + with: |
| 52 | + path: | |
| 53 | + ~/go/pkg/mod |
| 54 | + ~/.cache/go-build |
| 55 | + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
| 56 | + restore-keys: ${{ runner.os }}-go- |
| 57 | + - run: make test |
| 58 | + - uses: codecov/codecov-action@v1 |
| 59 | + with: |
| 60 | + fail_ci_if_error: true |
| 61 | + - uses: creekorful/goreportcard-action@v1.0 |
| 62 | + |
| 63 | + build: |
| 64 | + name: Build |
| 65 | + needs: test |
| 66 | + runs-on: ubuntu-latest |
| 67 | + steps: |
| 68 | + - uses: actions/checkout@v2 |
| 69 | + with: |
| 70 | + fetch-depth: 0 |
| 71 | + - uses: actions/setup-go@v2 |
| 72 | + with: |
| 73 | + go-version: ${{ env.GOVERSION }} |
| 74 | + - uses: actions/cache@v2 |
| 75 | + with: |
| 76 | + path: | |
| 77 | + ~/go/pkg/mod |
| 78 | + ~/.cache/go-build |
| 79 | + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
| 80 | + restore-keys: ${{ runner.os }}-go- |
| 81 | + - uses: goreleaser/goreleaser-action@v2 |
| 82 | + with: |
| 83 | + args: build --snapshot |
| 84 | + - uses: actions/upload-artifact@v2 |
| 85 | + with: |
| 86 | + name: binary |
| 87 | + path: dist/linux_linux_amd64/axiom |
| 88 | + |
| 89 | + binary-integration: |
| 90 | + name: Binary integration |
| 91 | + needs: build |
| 92 | + runs-on: ubuntu-latest |
| 93 | + env: |
| 94 | + AXM_TOKEN: ${{ secrets.TESTING_AZURE_1_STAGING_ACCESS_TOKEN }} |
| 95 | + AXM_URL: ${{ secrets.TESTING_AZURE_1_STAGING_DEPLOYMENT_URL }} |
| 96 | + steps: |
| 97 | + - uses: actions/checkout@v2 |
| 98 | + - uses: actions/download-artifact@v2 |
| 99 | + with: |
| 100 | + name: binary |
| 101 | + - run: chmod +x ./axiom |
| 102 | + - run: ./axiom version -I |
| 103 | + - run: ./axiom dataset create -n=cli-test-$GITHUB_RUN_ID -d="CLI Integration test $GITHUB_RUN_ID" |
| 104 | + - run: cat testdata/logs.csv | ./axiom ingest cli-test-$GITHUB_RUN_ID |
| 105 | + - run: cat testdata/logs.json | ./axiom ingest cli-test-$GITHUB_RUN_ID |
| 106 | + - run: cat testdata/logs.ndjson | ./axiom ingest cli-test-$GITHUB_RUN_ID |
| 107 | + - run: ./axiom ingest cli-test-$GITHUB_RUN_ID -f=testdata/logs.ndjson |
| 108 | + - run: ./axiom ingest cli-test-$GITHUB_RUN_ID -f=testdata/logs.json -f=testdata/logs.csv |
| 109 | + - run: ./axiom dataset info cli-test-$GITHUB_RUN_ID |
| 110 | + - run: ./axiom dataset list |
| 111 | + - name: Cleanup |
| 112 | + if: ${{ always() }} |
| 113 | + run: ./axiom dataset delete -f cli-test-$GITHUB_RUN_ID |
0 commit comments