-
Notifications
You must be signed in to change notification settings - Fork 86
48 lines (46 loc) · 1.32 KB
/
ci.yml
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
name: ci
on:
pull_request:
push:
branches:
- master
tags:
- v*
jobs:
test:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
go: [ 'stable', 'oldstable' ]
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} - go${{ matrix.go }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Test gofmt
if: runner.os == 'Linux'
run: test -z "$(gofmt -l .)"
- name: Run go test
run: go test ./...
- name: Run go build
run: go build -o gokey ./cmd/gokey
- name: Command line password is preferred to a password file
if: runner.os == 'Linux'
run: |
echo -n wrong > /tmp/pass
[ $(./gokey -p hunter2 -P /tmp/pass -r test) == 'X"fZba:0S>' ]
- name: Password file is preferred to the environment variable
if: runner.os == 'Linux'
run: |
echo -n hunter2 > /tmp/pass
[ $(./gokey -P /tmp/pass -r test) == 'X"fZba:0S>' ]
env:
GOKEY_ROOT_PASS: wrong
- name: Set password through the environment variable
if: runner.os == 'Linux'
run: |
[ $(./gokey -r test) == 'X"fZba:0S>' ]
env:
GOKEY_ROOT_PASS: hunter2