get.porter.sh/porter@v1.3.0/.github/workflows/porter.yml (about)

     1  name: porter
     2  on:
     3    push:
     4      branches:
     5      - main
     6    pull_request:
     7      branches:
     8      - main
     9      paths-ignore:
    10        - 'docs/**'
    11  env:
    12    GOVERSION: 1.24.4
    13  
    14  jobs:
    15    Build:
    16      name: Native Compile
    17      runs-on: ubuntu-latest
    18      steps:
    19      - name: checkout
    20        uses: actions/checkout@v3.5.0
    21      - uses: actions/setup-go@v4
    22        with:
    23          go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use.
    24          cache: true
    25      - run: go version
    26      - name: Native Build
    27        run: go run mage.go build
    28        shell: bash
    29      - name: Check if all doc changes have been pushed
    30        run: |
    31          if [ "$(git status --porcelain docs/)" ];
    32          then
    33            echo "There are changes to the documentation that have not been pushed! Please push the following files after build"
    34            git status -s docs/
    35            exit 1
    36          else
    37            echo "All documentation changes have been pushed"
    38          fi
    39        shell: bash
    40      - name: Publish Native Binaries
    41        uses: actions/upload-artifact@v4.4.0
    42        with:
    43          name: build-bin
    44          path: "${{ github.workspace }}/bin"
    45  
    46    XBuild:
    47      name: Cross Compile
    48      runs-on: ubuntu-latest
    49      steps:
    50      - name: checkout
    51        uses: actions/checkout@v3.5.0
    52      - uses: actions/setup-go@v4
    53        with:
    54          go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use.
    55          cache: true
    56      - run: go version
    57      - name: Cross Compile
    58        run: go run mage.go -v XBuildAll
    59        shell: bash
    60      - name: Publish Release Binaries
    61        uses: actions/upload-artifact@v4.4.0
    62        with:
    63          name: xbuild-bin
    64          path: "${{ github.workspace }}/bin"
    65  
    66    Unit_test:
    67      name: Unit Test
    68      runs-on: ubuntu-latest
    69      steps:
    70      - name: checkout
    71        uses: actions/checkout@v3.5.0
    72      - uses: actions/setup-go@v4
    73        with:
    74          go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use.
    75          cache: true
    76      - run: go version
    77      - name: Unit Test
    78        run: go run mage.go -v TestUnit
    79        shell: bash
    80  
    81    VetLint:
    82      name: Vet and Lint
    83      runs-on: ubuntu-latest
    84      steps:
    85      - name: checkout
    86        uses: actions/checkout@v3.5.0
    87      - uses: actions/setup-go@v4
    88        with:
    89          go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use.
    90          cache: true
    91      - run: go version
    92      - name: Vet
    93        run: go run mage.go Vet
    94        shell: bash
    95      - name: Lint
    96        run: go run mage.go Lint
    97        shell: bash
    98  
    99    Build-docker-images:
   100      name: Build Docker Images
   101      needs:
   102      - XBuild
   103      runs-on: ubuntu-latest
   104      if: success()
   105      steps:
   106      - name: checkout
   107        uses: actions/checkout@v3.5.0
   108      - uses: actions/setup-go@v4
   109        with:
   110          go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use.
   111          cache: true
   112      - run: go version
   113      - name: Download Cross-Compiled Porter Binaries
   114        uses: actions/download-artifact@v4.1.8
   115        with:
   116          name: xbuild-bin
   117          path: bin
   118      - name: Setup Bin
   119        run: go run mage.go UseXBuildBinaries
   120      - name: Build Docker Images
   121        run: go run mage.go BuildImages
   122  
   123    Smoke-test:
   124      name: Smoke Test
   125      needs:
   126        - XBuild
   127      runs-on: ubuntu-latest
   128      steps:
   129      - name: checkout
   130        uses: actions/checkout@v3.5.0
   131      - name: Download Cross-Compiled Porter Binaries
   132        uses: actions/download-artifact@v4.1.8
   133        with:
   134          name: xbuild-bin
   135          path: bin
   136      - uses: actions/setup-go@v4
   137        with:
   138          go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use.
   139          cache: true
   140      - run: go version
   141      - name: Setup Bin
   142        run: go run mage.go UseXBuildBinaries
   143      - name: Run Smoke Tests
   144        run: go run mage.go -v TestSmoke