diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index 88825ae..975d28f 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -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 + diff --git a/Makefile b/Makefile index 3b8800f..49ad7d9 100644 --- a/Makefile +++ b/Makefile @@ -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 ./... @@ -77,4 +74,4 @@ endif .PHONY: .lint .lint: $(info Running lint...) - $(GOLANGCI_BIN) run --fix ./... + $(GOLANGCI_BIN) run --fix --timeout 3m0s ./...