-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (46 loc) · 1.56 KB
/
ci.yml
File metadata and controls
49 lines (46 loc) · 1.56 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install shellcheck
run: sudo apt-get install -y shellcheck
- name: Lint bin/envctl
run: shellcheck -S warning bin/envctl install.sh
test:
name: Tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Make executable
run: chmod +x bin/envctl install.sh
- name: Version check
run: bin/envctl version
- name: Help check
run: bin/envctl help
- name: Set and list
run: |
mkdir -p /tmp/envctl-test
ENVCTL_DIR=/tmp/envctl-test bin/envctl set ai TEST_KEY=hello123
ENVCTL_DIR=/tmp/envctl-test bin/envctl get ai TEST_KEY | grep -q "hello123"
ENVCTL_DIR=/tmp/envctl-test bin/envctl list | grep -q "TEST_KEY"
- name: Remove key
run: |
ENVCTL_DIR=/tmp/envctl-test bin/envctl rm ai TEST_KEY
ENVCTL_DIR=/tmp/envctl-test bin/envctl list | grep -qv "TEST_KEY" || true
- name: Multiple clusters
run: |
ENVCTL_DIR=/tmp/envctl-test bin/envctl set cloud AWS_KEY=fake-aws
ENVCTL_DIR=/tmp/envctl-test bin/envctl set dev GITHUB_TOKEN=fake-gh
ENVCTL_DIR=/tmp/envctl-test bin/envctl list | grep -q "AWS_KEY"
ENVCTL_DIR=/tmp/envctl-test bin/envctl list | grep -q "GITHUB_TOKEN"