-
-
Notifications
You must be signed in to change notification settings - Fork 65
88 lines (72 loc) · 2.24 KB
/
Copy pathtest.yml
File metadata and controls
88 lines (72 loc) · 2.24 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Run tests
on:
workflow_dispatch:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- name: Load .env file
shell: bash
run: grep -v '^#' .env | sed 's/"//g' >> $GITHUB_ENV
- name: Setup Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: |
go.sum
tools.sum
- name: Install Exiftool (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install -y libimage-exiftool-perl
- name: Install Exiftool (macOS)
if: matrix.os == 'macos-latest'
run: brew install exiftool
- name: Install Exiftool (Windows)
if: matrix.os == 'windows-latest'
uses: MinoruSekine/setup-scoop@v4.0.1
with:
apps: exiftool
- name: Install Just
if: matrix.os != 'windows-latest'
uses: taiki-e/install-action@just
- name: Run tests (non-Windows)
if: matrix.os != 'windows-latest'
run: just test
- name: Run tests (Windows)
if: matrix.os == 'windows-latest'
# disable -race for now
run: go test ./... -coverprofile=coverage.out -coverpkg=.
- name: Run Go Vulnerability Check
if: matrix.os == 'ubuntu-latest'
run: just vulncheck
trigger_stable_release:
runs-on: ubuntu-latest
needs: test
if: github.ref_type == 'tag'
permissions:
contents: write
steps:
- name: Trigger repository_dispatch event
run: |
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
https://api.github.com/repos/ayoisaiah/f2/dispatches \
-d '{"event_type": "release_stable", "client_payload":{"tag": "${{ github.ref }}", "tag_name": "${{ github.ref_name }}" }}'