blob: 2f2521ac88a77902fb7b20f3697edbe0cda0b397 [file] [log] [blame]
Mohammed Nasercd45be92022-08-29 15:07:17 -04001name: lint
2on:
3 pull_request:
Mohammed Nasercd45be92022-08-29 15:07:17 -04004
5jobs:
6 ansible-lint:
7 runs-on: ubuntu-latest
Mohammed Nasere8795362022-08-31 17:52:58 -04008 container: haxorof/ansible-lint:v6
Mohammed Nasercd45be92022-08-29 15:07:17 -04009 steps:
10 - uses: actions/checkout@v3.0.2
Mohammed Nasere8795362022-08-31 17:52:58 -040011 - run: ansible-lint roles
12 env:
13 GITHUB_ACTIONS: true
14 GITHUB_WORKFLOW: "{{ github.workflow.name }}"
Mohammed Naser7eadd242022-09-01 18:53:16 -040015
16 images:
17 runs-on: ubuntu-latest
18 steps:
19 - name: Checkout
20 uses: actions/checkout@v3.0.2
21
22 - name: Set up Go
23 uses: actions/setup-go@v3.3.0
24 with:
25 go-version-file: go.mod
26 cache: true
27
28 - name: Set up gotestfmt
29 uses: haveyoudebuggedit/gotestfmt-action@v2
Mohammed Naser8aad7f02022-09-01 18:55:44 -040030
31 - name: Run tests
32 run: |
Mohammed Naser7eadd242022-09-01 18:53:16 -040033 set -euo pipefail
34 go test -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
35
36 - name: Upload test log
dependabot[bot]e24a0062022-09-02 03:39:33 +000037 uses: actions/upload-artifact@v3
Mohammed Naser7eadd242022-09-01 18:53:16 -040038 if: always()
39 with:
40 name: test-log
41 path: /tmp/gotest.log
42 if-no-files-found: error