summaryrefslogtreecommitdiff
path: root/.github/workflows/build.yml
blob: 1ec9fe305a0b57368150f219210b02a2608a132c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Build
on:
  push:
    branches: [ main ]
    tags: [ 'v*' ]
  pull_request:
    branches: [ main ]

jobs:
  linux-build:
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/hairyhenderson/gomplate-ci-build
    steps:
      - run: |
          git config --global user.email "bogus@example.com"
          git config --global user.name "Someone"
          git config --global --add safe.directory /__w/gomplate/gomplate
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - run: make build
      - name: Save binary
        uses: actions/upload-artifact@v4
        with:
          name: gomplate
          path: bin/gomplate
      - run: make test
      - run: make integration
  windows-build:
    runs-on: windows-latest
    env:
      # note: the tmp dir is set to C: so that it's not on the same drive as the
      # repo, which is on D: - this will expose bugs with path handling!
      TMP: C:\tmp
    steps:
      - run: pwd
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: actions/setup-go@v5
        with:
          go-version-file: go.mod
      - run: |
          git config --global user.email "bogus@example.com"
          git config --global user.name "Someone"
      - run: make build
      - name: Save binary
        uses: actions/upload-artifact@v4
        with:
          name: gomplate.exe
          path: bin/gomplate.exe
      - run: make test
      - run: make integration