mirror of
https://github.com/lukaszraczylo/kportal.git
synced 2026-07-10 06:52:00 +00:00
Update the autoupdate workflow
This commit is contained in:
@@ -13,40 +13,15 @@ permissions:
|
|||||||
actions: write
|
actions: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# This job is responsible for preparation of the build
|
autoupdate:
|
||||||
# environment variables.
|
name: Update dependencies and test
|
||||||
prepare:
|
|
||||||
name: Preparing build context
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
id: cache
|
|
||||||
with:
|
with:
|
||||||
go-version: ${{env.GO_VERSION}}
|
fetch-depth: 0
|
||||||
cache-dependency-path: "**/*.sum"
|
|
||||||
|
|
||||||
- name: Go get dependencies
|
|
||||||
if: steps.cache.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
go get ./...
|
|
||||||
|
|
||||||
# This job is responsible for running tests and linting the codebase
|
|
||||||
test:
|
|
||||||
name: "Unit testing"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container: golang:1
|
|
||||||
needs: [prepare]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0 # Ensure full history is checked out
|
|
||||||
|
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
@@ -54,19 +29,14 @@ jobs:
|
|||||||
go-version: ${{env.GO_VERSION}}
|
go-version: ${{env.GO_VERSION}}
|
||||||
cache-dependency-path: "**/*.sum"
|
cache-dependency-path: "**/*.sum"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Update dependencies
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
go get -u ./...
|
||||||
apt-get install ca-certificates make -y
|
|
||||||
update-ca-certificates
|
|
||||||
go mod tidy
|
go mod tidy
|
||||||
go get -u -v ./...
|
|
||||||
go mod tidy -v
|
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: |
|
run: |
|
||||||
CI_RUN=${CI} make test
|
go test -race -cover ./...
|
||||||
git config --global --add safe.directory /__w/kportal/kportal
|
|
||||||
|
|
||||||
- name: Commit changes
|
- name: Commit changes
|
||||||
id: auto-commit
|
id: auto-commit
|
||||||
|
|||||||
Reference in New Issue
Block a user