Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
Add "Linter" and "Create release" pipelines (#3)
Browse files Browse the repository at this point in the history
* Add Linter pipeline

* Disable MD013 for README.md

* Fix Ruby lint warnings

* Fix Ruby lint warnings

* Fix Ruby lint warnings

* Fix functional tests
  • Loading branch information
fabasoad authored Jan 1, 2021
1 parent a1b67f3 commit 1dd2fa4
Show file tree
Hide file tree
Showing 22 changed files with 149 additions and 149 deletions.
2 changes: 2 additions & 0 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
BUNDLE_PATH: ".bundle"
25 changes: 16 additions & 9 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,32 @@ assignees: fabasoad

---

**Describe the bug**
## Describe the bug

A clear and concise description of what the bug is.

**Steps to Reproduce**
## Steps to Reproduce

1. Run '...'
2. See error

**Expected behavior**
## Expected behavior

A clear and concise description of what you expected to happen.

**Actual behavior**
## Actual behavior

A clear and concise description of what is happening now.

**Screenshots**
## Screenshots

If applicable, add screenshots to help explain your problem.

**Technical information (please complete the following information):**
- OS: [e.g. Windows 10 Enterprise v.1909 (OS Build 18363.720)]
- `linguist-action` version [e.g. 1.0.1]
## Technical information (please complete the following information)

- OS: [e.g. Windows 10 Enterprise v.1909 (OS Build 18363.720)]
- `linguist-action` version [e.g. 1.0.1]

## Additional context

**Additional context**
Add any other context about the problem here.
15 changes: 8 additions & 7 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
Closes #<Issue Number>
<!-- markdownlint-disable-file MD041 -->

Closes #{IssueNumber}

## Pull request checklist

Please check if your PR fulfills the following requirements:

- [ ] I have read the [CONTRIBUTING](https://github.com/fabasoad/linguist-action/CONTRIBUTING.md) doc.
- [ ] Tests for the changes have been added (for bug fixes / features).
- [ ] Docs have been reviewed and added / updated if needed (for bug fixes / features).
- [ ] Functionality was run locally and any fixes were made for failures.

## Pull request type

<!-- Please do not submit updates to dependencies unless it fixes an issue. -->
<!-- Please do not submit updates to dependencies unless it fixes an issue. -->

<!-- Please try to limit your pull request to one type, submit multiple pull requests if needed. -->
<!-- Please try to limit your pull request to one type, submit multiple pull requests if needed. -->

Please check the type of change your PR introduces:

- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

- [ ] Other (please describe):

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->


## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by this PR. -->

Expand All @@ -42,7 +44,6 @@ Please check the type of change your PR introduces:

<!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. -->
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Create release

on:
push:
branches:
- main

jobs:
create_release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Get commits since last release
id: changes
uses: simbo/changes-since-last-release-action@v1
- name: Get latest version
id: substring
run: |
ver=$(echo "${{ steps.changes.outputs.last-tag }}" | cut -c2-)
echo '::set-output name=version::'$ver
- name: Increase version
id: semver
uses: matt-FFFFFF/simple-semver@v0.1.0
with:
semver-input: ${{ steps.substring.outputs.version }}
increment: p
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.semver.outputs.semver }}
release_name: v${{ steps.semver.outputs.semver }}
body: |
# Changes
${{ steps.changes.outputs.log }}
draft: false
prerelease: false
20 changes: 0 additions & 20 deletions .github/workflows/dockerfile-lint.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
percentage: true
- name: Validate linguist result
run: |
[[ '{"Ruby":"76.68%","Dockerfile":"19.31%","Shell":"4.01%"}' == '${{ steps.linguist.outputs.data }}' ]] || exit 1;
[[ '{"Ruby":"74.38%","Dockerfile":"20.80%","Shell":"4.83%"}' == '${{ steps.linguist.outputs.data }}' ]] || exit 1;
25 changes: 25 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Lint

on:
push:
branches:
- main
- 'bugfix/**'
- 'feature/**'

jobs:
build:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
- name: Lint Code Base
uses: github/super-linter@v3.14.3
env:
VALIDATE_ALL_CODEBASE: true
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 0 additions & 18 deletions .github/workflows/ruby-lint.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/security-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
run: |
docker build -t ${{ github.repository }}:${{ github.sha }} .
snyk auth ${{ secrets.SNYK_API_TOKEN }}
snyk test --docker ${{ github.repository }}:${{ github.sha }} --file=Dockerfile
snyk test --docker ${{ github.repository }}:${{ github.sha }} --file=Dockerfile --exclude-base-image-vulns
16 changes: 0 additions & 16 deletions .github/workflows/shell-lint.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/yaml-lint.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.bundle/*
!.bundle/config
.vscode/*
!.vscode/settings.json
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"cSpell.words": [
"andrewmcodes",
"appium",
"bewuethr",
"burdzwastaken",
"hadolint",
"ibiqlik",
"issuehunt",
"liberapay",
"markdownlint",
"semver",
"simbo",
"sloc",
"vulns",
"yamllint"
]
}
7 changes: 0 additions & 7 deletions .yamllint.yml

This file was deleted.

14 changes: 12 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Contributing guidance

We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:

- Reporting a bug
Expand All @@ -8,9 +9,11 @@ We love your input! We want to make contributing to this project as easy and tra
- Becoming a maintainer

## We Develop with GitHub

We use GitHub to host code, to track issues and feature requests, as well as accept pull requests.

## We Use [GitHub Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests

Pull requests are the best way to propose changes to the codebase (we use [GitHub Flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests:

1. Fork the repo and create your branch from `main`.
Expand All @@ -21,21 +24,28 @@ Pull requests are the best way to propose changes to the codebase (we use [GitHu
6. Issue that pull request!

## Any contributions you make will be under the MIT Software License

In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern.

## Report bugs using [GitHub Issues](https://github.com/fabasoad/linguist-action/issues)

We use GitHub issues to track public bugs. Report a bug by opening a new issue. It's that easy!

## Create issue using provided GitHub issue templates

This repository has issue templates for bug report and feature request. Please use them to create an issue and fill all required fields.

## Use a Consistent Coding Style

Please follow all the rules from the following documents:

- [Bash coding style](https://github.com/icy/bash-coding-style) provided by [icy](https://github.com/icy).
- [Ruby coding style](https://www.w3resource.com/ruby/ruby-style-guide.php) provided by w3resource.
- [Ruby coding style](https://www.w3resource.com/ruby/ruby-style-guide.php) provided by w3resource.

## License

By contributing, you agree that your contributions will be licensed under its MIT License.

## References
This document was adapted from the open-source contribution guidelines provided by [briandk](https://gist.github.com/briandk/3d2e8b3ec8daf5a27a62).

This document was adapted from the open-source contribution guidelines provided by [briandk](https://gist.github.com/briandk/3d2e8b3ec8daf5a27a62).
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
FROM ruby:2.7.1-buster
FROM ruby:3.0.0-buster

RUN apt-get update ;\
apt-get install -y --no-install-recommends cmake=3.13.4-1 ruby-dev=1:2.5.1 ;\
apt-get clean ;\
rm -rf /var/lib/apt/lists/*
RUN gem install bundler -v 2.1.4
RUN apt-get update && apt-get install -y --no-install-recommends cmake=3.13.4-1 ruby-dev=1:2.5.1 ;\
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN gem install bundler -v 2.2.4

COPY Gemfile /Gemfile
RUN bundle install
RUN cat Gemfile.lock

COPY linguist.rb /linguist.rb
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT [ "/docker-entrypoint.sh" ]
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source 'https://rubygems.org' do
gem 'github-linguist', '7.8.0'
gem 'github-linguist', '7.12.2'
end
21 changes: 0 additions & 21 deletions Gemfile.lock

This file was deleted.

Loading

0 comments on commit 1dd2fa4

Please sign in to comment.