decred.org/dcrdex@v1.0.3/.github/workflows/build.yml (about)

     1  name: Build and Test
     2  on: [push, pull_request]
     3  permissions:
     4    contents: read
     5  jobs:
     6    build-go:
     7      name: Go CI
     8      runs-on: ubuntu-22.04
     9      strategy:
    10        matrix:
    11          go: ['1.22', '1.23']
    12      steps:
    13        - uses: awalsh128/cache-apt-pkgs-action@5902b33ae29014e6ca012c5d8025d4346556bd40 #v1.4.3
    14          with:
    15            packages: git-restore-mtime libgtk-3-dev libwebkit2gtk-4.0-dev
    16            version: 1.0
    17  
    18        - name: Set up Go
    19          uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 #v5.3.0
    20          with:
    21            go-version: ${{ matrix.go }}
    22  
    23        - name: Check out source
    24          uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
    25          with:
    26            fetch-depth: 0
    27        # Restore original file modification times for test cache reasons
    28        - name: restore timestamps
    29          run: git restore-mtime
    30        - name: Install Linters
    31          run: "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.2"
    32        - name: Use test and module cache
    33          uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0
    34          with:
    35            path: |
    36              ~/.cache/go-build
    37              ~/go/pkg/mod
    38            key: go-test-${{ matrix.go }}-${{ github.sha }}
    39            restore-keys: go-test-${{ matrix.go }}
    40  
    41        - name: Test
    42          env:
    43            GO111MODULE: "on"
    44          run: |
    45            mkdir -p client/webserver/site/dist
    46            touch -t 2306151245 client/webserver/site/dist/placeholder
    47            ./run_tests.sh
    48    build-js:
    49      name: Build JS
    50      runs-on: ubuntu-latest
    51      strategy:
    52        matrix:
    53          node-version: [18.x, 20.x]
    54      steps:
    55      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
    56      - name: Use nodejs ${{ matrix.node-version }}
    57        uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a #v4.2.0
    58        with:
    59          node-version: ${{ matrix.node-version }}
    60      - name: npm clean-install
    61        working-directory: ./client/webserver/site
    62        run: npm ci
    63      - name: npm run lint
    64        working-directory: ./client/webserver/site
    65        run: npm run lint
    66      - name: npm run build
    67        working-directory: ./client/webserver/site
    68        run: npm run build
    69  
    70    lint-docs:
    71      name: Lint Markdown
    72      runs-on: ubuntu-latest
    73      steps:
    74      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
    75      - uses: DavidAnson/markdownlint-cli2-action@05f32210e84442804257b2a6f20b273450ec8265 #v19.1.0
    76        continue-on-error: true
    77        with:
    78          globs: |
    79            *.md
    80            docs/**/*.md