Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI testing #11

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ./...
Loading