From 413a3df17d0f1010ce5c9eefaaa0f8346bdb3d64 Mon Sep 17 00:00:00 2001 From: David Ferlay Date: Wed, 12 Jun 2024 15:38:46 +0200 Subject: [PATCH] CI addition --- .github/workflows/commit.yml | 103 +++++++++++++++++++++++++++++++++++ LICENSE | 2 + Makefile | 2 +- 3 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/commit.yml diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml new file mode 100644 index 0000000..fa641bc --- /dev/null +++ b/.github/workflows/commit.yml @@ -0,0 +1,103 @@ +name: Commit Workflow + +on: + push: + workflow_dispatch: + +jobs: + no-tty-in-ci: + name: Ensure no TTY if user does not need to input anything + runs-on: ubuntu-latest + env: + ARTIFACTS_REPOSITORY_USERNAME: ${{ secrets.ARTIFACTS_REPOSITORY_USERNAME }} + ARTIFACTS_REPOSITORY_PASSWORD: ${{ secrets.ARTIFACTS_REPOSITORY_PASSWORD }} + ANSIBLE_VAULT_PW: ${{ secrets.ANSIBLE_VAULT_PW }} + PLASMACTL_KEYRING_PASSWORD: ${{ secrets.PLASMACTL_KEYRING_PASSWORD }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Commands + run: | + set -x + date + pwd + whoami + make deps build + ls -lah bin/launchr + mkdir -p .compose/build/ + mkdir -p .compose/artifacts/ + tar -czf .compose/artifacts/plasmactl-bump-xxx-plasma-src.tar.gz --exclude=plasmactl-bump-xxx-plasma-src.tar.gz . + ./bin/launchr bump --sync --username "xxx" --password "xxx" --vault-pass "xxx" --keyring-passphrase "xxx" --override "xxx" -vvv + + commands-ok: + name: Ensure main commands do not fail + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Commands + run: | + set -x + date + pwd + whoami + make deps build + ls -lah bin/launchr + mkdir -p interaction/softwares/roles/whatever/meta/ + cat < interaction/softwares/roles/whatever/meta/plasma.yaml + plasma: + author: Whoever + categories: + - kind.software + - machine + description: Whatever + license: MIT + version: 197d7ab84a2b4 + EOF + touch interaction/softwares/roles/whatever/meta/whatever + cat interaction/softwares/roles/whatever/meta/whatever + git add -A + git config --global user.email "citesting@example.com" + git config --global user.name "CI testing" + git commit -m "CI testing" + ./bin/launchr bump + + 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/LICENSE b/LICENSE index 261eeb9..f67198d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,6 @@ Apache License + + Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/Makefile b/Makefile index 373e3fe..b348758 100644 --- a/Makefile +++ b/Makefile @@ -74,4 +74,4 @@ endif .PHONY: .lint .lint: $(info Running lint...) - $(GOLANGCI_BIN) run --fix ./... + $(GOLANGCI_BIN) run --fix --timeout 3m0s ./...