github.com/jaypipes/ghw@v0.21.1/.github/workflows/test.yml (about)

     1  name: test
     2  
     3  on:
     4    push:
     5      branches: [ main ]
     6    pull_request:
     7      branches: [ main ]
     8  
     9  permissions:
    10    contents: read
    11  
    12  # see: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
    13  jobs:
    14    # tier-1
    15    # main development platform, gets features first and it's most tested
    16    ubuntu-latest:
    17      runs-on: ubuntu-latest
    18      strategy:
    19        matrix:
    20          go: ['1.22', '1.23', '1.24']
    21      steps:
    22       - name: harden runner
    23         uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
    24         with:
    25           egress-policy: block
    26           disable-sudo: true
    27           allowed-endpoints: >
    28             github.com:443
    29             api.github.com:443
    30             proxy.github.com:443
    31             proxy.golang.org:443
    32             raw.githubusercontent.com:443
    33             objects.githubusercontent.com:443
    34             proxy.golang.org:443
    35       - name: checkout code
    36         uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
    37       - name: setup go
    38         uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
    39         with:
    40           go-version: ${{ matrix.go }}
    41       - name: run tests
    42         env:
    43           GHW_TESTING_SKIP_BLOCK: "1"
    44           GHW_TESTING_SKIP_GPU: "1"
    45         run: go test -v ./...
    46  
    47    ubuntu-2204:
    48      runs-on: ubuntu-22.04
    49      strategy:
    50        matrix:
    51          go: ['1.21', '1.22', '1.23']
    52      steps:
    53       - name: harden runner
    54         uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
    55         with:
    56           egress-policy: audit
    57           disable-sudo: true
    58           allowed-endpoints: >
    59             github.com:443
    60             api.github.com:443
    61             proxy.github.com:443
    62             proxy.golang.org:443
    63             raw.githubusercontent.com:443
    64             objects.githubusercontent.com:443
    65             proxy.golang.org:443
    66       - name: checkout code
    67         uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
    68       - name: setup go
    69         uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
    70         with:
    71           go-version: ${{ matrix.go }}
    72       - name: run tests
    73         env:
    74           GHW_TESTING_SKIP_BLOCK: "1"
    75           GHW_TESTING_SKIP_GPU: "1"
    76         run: go test -v ./...
    77  
    78    windows-2022:
    79      runs-on: windows-2022
    80      strategy:
    81        matrix:
    82          go: ['1.23', '1.24', '1.24']
    83      steps:
    84       - name: harden runner
    85         uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
    86         with:
    87           egress-policy: block
    88           disable-sudo: true
    89           allowed-endpoints: >
    90             github.com:443
    91             api.github.com:443
    92             proxy.github.com:443
    93             proxy.golang.org:443
    94             raw.githubusercontent.com:443
    95             objects.githubusercontent.com:443
    96             proxy.golang.org:443
    97       - name: checkout code
    98         uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
    99       - name: setup go
   100         uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
   101         with:
   102           go-version: ${{ matrix.go }}
   103       - name: run tests
   104         env:
   105           GHW_TESTING_SKIP_BLOCK: "1"
   106           GHW_TESTING_SKIP_GPU: "1"
   107           GHW_TESTING_SKIP_CPU: "1"
   108           GHW_TESTING_SKIP_MEMORY: "1"
   109           GHW_TESTING_SKIP_HOST: "1"
   110           GHW_TESTING_SKIP_NET: "1"
   111           GHW_TESTING_SKIP_PCI: "1"
   112           GHW_TESTING_SKIP_TOPOLOGY: "1"
   113         run: go test -v ./...
   114  
   115    # tier-2
   116    # best-effort support, limited to most recent platforms (OS+go)
   117  
   118    # NOTE(jaypipes): We currently only support block information on MacOS, and
   119    # the tests have block skipped because we cannot get meaningful information
   120    # about the block devices in the Github Actions Runner virtual machines. So
   121    # this is really just a test of whether the library builds on MacOS 13.
   122    macos-13:
   123      runs-on: macos-13
   124      strategy:
   125        matrix:
   126          go: ['1.22', '1.23']
   127      steps:
   128       - name: harden runner
   129         uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
   130         with:
   131           egress-policy: block
   132           disable-sudo: true
   133           allowed-endpoints: >
   134             github.com:443
   135             api.github.com:443
   136             proxy.github.com:443
   137             proxy.golang.org:443
   138             raw.githubusercontent.com:443
   139             objects.githubusercontent.com:443
   140             proxy.golang.org:443
   141       - name: checkout code
   142         uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
   143       - name: setup go
   144         uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
   145         with:
   146           go-version: ${{ matrix.go }}
   147       - name: run tests
   148         env:
   149           GHW_TESTING_SKIP_BLOCK: "1"
   150           GHW_TESTING_SKIP_CPU: "1"
   151           GHW_TESTING_SKIP_GPU: "1"
   152           GHW_TESTING_SKIP_HOST: "1"
   153           GHW_TESTING_SKIP_MEMORY: "1"
   154           GHW_TESTING_SKIP_NET: "1"
   155           GHW_TESTING_SKIP_PCI: "1"
   156           GHW_TESTING_SKIP_TOPOLOGY: "1"
   157         run: go test -v ./...