From 8e8ea09da4de521aa497fb78fc60d6f056b2d3e2 Mon Sep 17 00:00:00 2001 From: Aaron Guise Date: Tue, 23 Apr 2024 16:50:20 +1200 Subject: [PATCH] =?UTF-8?q?fix:=20Added=20workflow=20for=20Actions=20?= =?UTF-8?q?=F0=9F=91=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 76 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c90f9c9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,76 @@ +name: CI +on: push + +jobs: + # lint: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-go@v5 + # with: + # go-version: '1.22' + # - uses: golangci/golangci-lint-action@v3 + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'pip' # caching pip dependencies + - name: Ensure requirements are installed + run: pip install -r requirements.txt + - name: Lint with ansible-lint + run: ansible-lint -c ".ansible-lint" + env: + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' + molecule: + name: Molecule Tests ${{ matrix.os }} + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + os: [almalinux8, almalinux9] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'pip' # caching pip dependencies + + - name: Ensure requirements are installed + run: pip install -r requirements.txt + + - name: Run Molecule tests. + run: molecule test + env: + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' + MOLECULE_DISTRO: ${{ matrix.os }} + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: '1.22' + - name: Install gitea provider for Go Semantic Release + run: | + mkdir -p .semrel/$(go env GOOS)_$(go env GOARCH)/provider-gitea/${GITEA_PROVIDER_VER}/ && \ + wget https://github.com/cybercinch/go-semantic-release-provider-gitea/releases/download/v${GITEA_PROVIDER_VER}/go-semantic-release-provider-gitea_v${GITEA_PROVIDER_VER}_linux_amd64 \ + -O .semrel/$(go env GOOS)_$(go env GOARCH)/provider-gitea/${GITEA_PROVIDER_VER}/gitea && \ + chmod a+x .semrel/$(go env GOOS)_$(go env GOARCH)/provider-gitea/${GITEA_PROVIDER_VER}/gitea + env: + GITEA_PROVIDER_VER: 1.0.9 + - run: | + echo "github repo: ${GITHUB_REPOSITORY}" + - uses: go-semantic-release/action@v1 + with: + custom-arguments: --provider=gitea + env: + GITEA_TOKEN: ${{ secrets.G_TOKEN }} + GITEA_HOST: ${{ secrets.G_SERVER_URL}} \ No newline at end of file