name: CI

on: [push]

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        go: [ '1.18', '1.17', '1.16', '1.15' ]
        os: [ ubuntu-latest, macOS-latest, windows-latest ]
    name: ${{ matrix.os }} Go ${{ matrix.go }} Tests
    steps:
      - uses: actions/checkout@v3
      - name: Setup go
        uses: actions/setup-go@v3
        with:
          go-version: ${{ matrix.go }}
      - run: go test

  test-non-amd64:
    strategy:
      fail-fast: false
      matrix:
        arch:
          # For some reasons this is segfaulting on go env
          # - name: IBM Z and LinuxONE
          #   architecture: "s390x"
          - name: POWER8
            architecture: "ppc64le"

    runs-on: ubuntu-latest
    name: Test on ${{ matrix.arch.name }}
    steps:
      - uses: actions/checkout@v2
      - uses: uraimo/run-on-arch-action@master
        with:
          arch: ${{ matrix.arch.architecture }}
          distro: ubuntu20.04
          env: | # YAML pipe
            GOARCH: ${{ matrix.arch.architecture }}
            CGO_ENABLED: 0
            GOPRIVATE: github.com/joho/godotenv
          run: |
            apt-get update
            apt-get install -q -y curl wget git
            latestGo=$(curl "https://go.dev/VERSION?m=text")
            wget "https://dl.google.com/go/${latestGo}.linux-${GOARCH}.tar.gz"
            rm -f $(which go)
            rm -rf /usr/local/go
            tar -C /usr/local -xzf "${latestGo}.linux-${GOARCH}.tar.gz"
            export PATH=/usr/local/go/bin:$PATH
            printf "Using go at: $(which go)\n"
            printf "Go version: $(go version)\n"
            printf "\n\nGo environment:\n\n"
            go env
            printf "\n\nSystem environment:\n\n"
            env
            go get -v -t -d ./...
            go test ./...
            cd ./cmd/godotenv
            go build -trimpath -ldflags="-w -s" -v

name: CI

on: [push]

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        go: [ '1.18', '1.17', '1.16', '1.15' ]
        os: [ ubuntu-latest, macOS-latest, windows-latest ]
    name: ${{ matrix.os }} Go ${{ matrix.go }} Tests
    steps:
      - uses: actions/checkout@v3
      - name: Setup go
        uses: actions/setup-go@v3
        with:
          go-version: ${{ matrix.go }}
      - run: go test

Remove power8 again as it wasn't fixed
Remove power8 again as it wasn't fixed
