Skip to content

Commit

Permalink
CI testing
Browse files Browse the repository at this point in the history
  • Loading branch information
davidferlay committed May 23, 2024
1 parent 973c7f2 commit b098522
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 21 deletions.
88 changes: 71 additions & 17 deletions .github/workflows/commit.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,78 @@
name: Ensure no TTY if user does not need to input anythin
name: Commit Workflow

on:
push:
workflow_dispatch:

jobs:
job1:
name: Login
no-tty-in-ci:
name: Ensure no TTY if user does not need to input anything
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Commands
run: |
set -x
date
pwd
whoami
make deps build
ls -lah bin/launchr
./bin/launchr login --url=http://***.git --username="***" --password="***" --keyring-passphrase="***"
commands-ok:
name: Ensure main commands do not fail
runs-on: ubuntu-latest
env:
TOKEN_JSON: ${{ secrets.TOKEN_JSON }}
CREDENTIALS_JSON: ${{ secrets.CREDENTIALS_JSON }}

steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Commands
run: |
echo
date
pwd
whoami
make all
ls -lah bin/launchr
./bin/launchr login --url=http://***.git --username="***" --password="***" --keyring-passphrase="***"
- name: Checkout code
uses: actions/checkout@v3

- name: Commands
run: |
set -x
date
pwd
whoami
make deps build
ls -lah bin/launchr
./bin/launchr set vaultpass --value "***" --keyring-passphrase "***"
ls -lah .launchr/keyring.yaml.age
./bin/launchr unset vaultpass --keyring-passphrase "***"
ls -lah .launchr/keyring.yaml.age
go-linters:
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Commands
run: |
set -x
date
pwd
whoami
make lint
go-tests:
name: Run Go tests
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Commands
run: |
set -x
date
pwd
whoami
make test
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ test:
build:
$(info Building launchr...)
# Application related information available on build time.
@echo "APP_VERSION: $(APP_VERSION)"
@echo "GIT_BRANCH: $(GIT_BRANCH)"
@echo "GIT_HASH: $(GIT_HASH)"
$(eval LDFLAGS:=-X '$(GOPKG).name=launchr' -X '$(GOPKG).version=$(APP_VERSION)' $(LDFLAGS_EXTRA))
$(eval BIN?=$(LOCAL_BIN)/launchr)
go generate ./...
Expand Down Expand Up @@ -77,4 +74,4 @@ endif
.PHONY: .lint
.lint:
$(info Running lint...)
$(GOLANGCI_BIN) run --fix ./...
$(GOLANGCI_BIN) run --fix --timeout 3m0s ./...

0 comments on commit b098522

Please sign in to comment.