mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
chore(actions): use actions to sync node & go version
This commit is contained in:
committed by
Łukasz Mierzwa
parent
6b931ed54c
commit
ae32911f5d
43
.github/workflows/go-version.yml
vendored
Normal file
43
.github/workflows/go-version.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Go version
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- test-actions
|
||||
paths:
|
||||
- Dockerfile
|
||||
|
||||
jobs:
|
||||
go-version-sync:
|
||||
name: Synchronise go-version
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Get Go version from Dockerfile
|
||||
run: echo ::set-env name=GOVERSION::$(grep 'FROM golang:' Dockerfile | cut -d ':' -f2 | cut -d '-' -f1 | tr -d '\n')
|
||||
|
||||
- name: Synchronise Go version in actions
|
||||
uses: bejoistic/str-replace@v1.0.2
|
||||
with:
|
||||
find: "go-version: .+"
|
||||
replace: "go-version: ${{ env.GOVERSION }}"
|
||||
include: ".github/workflows/*"
|
||||
|
||||
- name: Create Pull Request
|
||||
id: cpr
|
||||
uses: peter-evans/create-pull-request@v3.5.0
|
||||
with:
|
||||
token: ${{ secrets.GH_REPO_TOKEN }}
|
||||
author: "Łukasz Mierzwa <l.mierzwa@gmail.com>"
|
||||
commit-message: "chore(actions): use latest Go version"
|
||||
branch: npm-upgrades
|
||||
delete-branch: true
|
||||
title: "chore(actions): use latest Go version"
|
||||
|
||||
- name: Check outputs
|
||||
run: |
|
||||
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
||||
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
||||
43
.github/workflows/node-version.yml
vendored
Normal file
43
.github/workflows/node-version.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Node version
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- test-actions
|
||||
paths:
|
||||
- Dockerfile
|
||||
|
||||
jobs:
|
||||
go-version-sync:
|
||||
name: Synchronise go-version
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Get Node version from Dockerfile
|
||||
run: echo ::set-env name=GOVERSION::$(grep 'FROM node:' Dockerfile | cut -d ':' -f2 | cut -d '-' -f1 | tr -d '\n')
|
||||
|
||||
- name: Synchronise Node version in actions
|
||||
uses: bejoistic/str-replace@v1.0.2
|
||||
with:
|
||||
find: "node-version: .+"
|
||||
replace: "node-version: ${{ env.GOVERSION }}"
|
||||
include: ".github/workflows/*"
|
||||
|
||||
- name: Create Pull Request
|
||||
id: cpr
|
||||
uses: peter-evans/create-pull-request@v3.5.0
|
||||
with:
|
||||
token: ${{ secrets.GH_REPO_TOKEN }}
|
||||
author: "Łukasz Mierzwa <l.mierzwa@gmail.com>"
|
||||
commit-message: "chore(actions): use latest Node version"
|
||||
branch: npm-upgrades
|
||||
delete-branch: true
|
||||
title: "chore(actions): use latest Node version"
|
||||
|
||||
- name: Check outputs
|
||||
run: |
|
||||
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
||||
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
||||
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Maintenance
|
||||
name: Stale
|
||||
|
||||
on:
|
||||
schedule:
|
||||
|
||||
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
@@ -323,12 +323,6 @@ jobs:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Lint Go Versions
|
||||
run: make lint-golang-version
|
||||
|
||||
- name: Lint Node JS Versions
|
||||
run: make lint-nodejs-version
|
||||
|
||||
- name: Lint Bootstrap Version
|
||||
run: make lint-bootstrap-version
|
||||
|
||||
|
||||
@@ -1,25 +1,3 @@
|
||||
.PHONY: find-golang-versions
|
||||
find-golang-versions:
|
||||
@find $(CURDIR) -name Dockerfile -exec grep 'FROM golang' {} \; | cut -d: -f2 | cut -d'-' -f1
|
||||
@grep go-version $(CURDIR)/.github/workflows/* | awk '{print $$3}'
|
||||
|
||||
.PHONY: lint-golang-version
|
||||
lint-golang-version:
|
||||
$(eval VERSIONS := $(shell make find-golang-versions | sort | uniq))
|
||||
$(eval COUNT := $(shell echo "$(VERSIONS)" | wc -w))
|
||||
@if [ $(COUNT) -gt 1 ]; then echo "Multiple Go versions: $(VERSIONS)" ; exit 1 ; fi
|
||||
|
||||
.PHONY: find-nodejs-versions
|
||||
find-nodejs-versions:
|
||||
@find $(CURDIR) -name Dockerfile -exec grep 'FROM node' {} \; | cut -d: -f2 | cut -d'-' -f1
|
||||
@grep node-version $(CURDIR)/.github/workflows/* | awk '{print $$3}'
|
||||
|
||||
.PHONY: lint-nodejs-version
|
||||
lint-nodejs-version:
|
||||
$(eval VERSIONS := $(shell make find-nodejs-versions | sort | uniq))
|
||||
$(eval COUNT := $(shell echo "$(VERSIONS)" | wc -w))
|
||||
@if [ $(COUNT) -gt 1 ]; then echo "Multiple NodeJS versions: $(VERSIONS)" ; exit 1 ; fi
|
||||
|
||||
.PHONY: lint-bootstrap-version
|
||||
lint-bootstrap-version:
|
||||
$(eval BOOTSTRAP_VERSION := $(shell grep bootstrap ui/package.json | cut -d: -f2 | tr -d ' ",'))
|
||||
|
||||
Reference in New Issue
Block a user