name: CI

on:
  push:
    branches: [master]
  pull_request:

jobs:
  test:
    name: Test
    runs-on: ${{ matrix.os }}

    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        go: ["1.23", "1.24"]

    steps:
      - name: Checkout repository
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - name: Set up Go
        uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
        with:
          go-version: ${{ matrix.go }}

      - name: Test
        run: go test -race -v ./...

      - name: Test gcsfs
        run: go test -race -v ./...
        working-directory: ./gcsfs

      - name: Test sftpfs
        run: go test -race -v ./...
        working-directory: ./sftpfs

  lint:
    name: Lint
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - name: Set up Go
        uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
        with:
          go-version: "1.24"

      - name: Lint
        uses: golangci/golangci-lint-action@4696ba8babb6127d732c3c6dde519db15edab9ea # v6.5.1
        with:
          version: v1.64.7
