Skip to content

Commit a522f53

Browse files
github-actions[bot]github-actionsfabasoad
authored
Set default version to 3.2 (#139)
## Changelog - Update license copyright year to 2025 --- Powered by [FantasticFiasco/action-update-license-year](https://github.com/FantasticFiasco/action-update-license-year) --------- Co-authored-by: github-actions <[email protected]> Co-authored-by: fabasoad <[email protected]>
1 parent 5ad4d09 commit a522f53

File tree

13 files changed

+281
-122
lines changed

13 files changed

+281
-122
lines changed

.github/workflows/functional-tests-local.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/functional-tests-remote.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
name: Functional Tests
3+
4+
on: # yamllint disable-line rule:truthy
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
paths:
10+
- .github/workflows/functional-tests.yml
11+
- src/**
12+
- action.yml
13+
schedule:
14+
# Every Friday at 09:00 JST
15+
- cron: "0 0 * * 5"
16+
workflow_dispatch: {}
17+
18+
defaults:
19+
run:
20+
shell: sh
21+
22+
jobs:
23+
run-script:
24+
name: Run script
25+
timeout-minutes: 5
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
version: ["3.2", "3.1.2", "3.1.1"]
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout ${{ github.repository }}
33+
uses: actions/checkout@v4
34+
- name: Setup COBOL
35+
uses: ./
36+
with:
37+
version: ${{ matrix.version }}
38+
- name: Validate script
39+
run: |
40+
cobc -x ./HelloWorld.cob
41+
[ "$(./HelloWorld)" = "Hello World!" ] || exit 1;
42+
43+
test-force:
44+
name: Test force
45+
runs-on: ubuntu-latest
46+
timeout-minutes: 5
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
force: ["true", "false"]
51+
steps:
52+
- name: Checkout ${{ github.repository }}
53+
uses: actions/checkout@v4
54+
- name: Setup COBOL 1
55+
id: setup-cobol-1
56+
uses: ./
57+
- name: Setup COBOL 2
58+
id: setup-cobol-2
59+
uses: ./
60+
with:
61+
force: ${{ matrix.force }}
62+
- name: Test action completion
63+
run: |
64+
test_equal() {
65+
if [ "${2}" != "${3}" ]; then
66+
echo "::error title=${1}::Expected: ${3}. Actual: ${2}."
67+
exit 1
68+
fi
69+
}
70+
test_equal "Wrong \"installed\" output from setup-cobol-1" \
71+
"${{ steps.setup-cobol-1.outputs.installed }}" \
72+
"true"
73+
test_equal "Wrong \"installed\" output from setup-cobol-2" \
74+
"${{ steps.setup-cobol-2.outputs.installed }}" \
75+
"${{ matrix.force }}"

.github/workflows/security.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ jobs:
1414
contents: read
1515
security-events: write
1616
uses: fabasoad/reusable-workflows/.github/workflows/wf-security-sast.yml@main
17+
with:
18+
code-scanning: true
19+
sca: true

.github/workflows/update-license.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: License
33

44
on: # yamllint disable-line rule:truthy
55
schedule:
6+
# Every January 1st at 14:00 JST
67
- cron: "0 5 1 1 *"
78

89
jobs:

.pre-commit-config.yaml

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,78 @@
11
---
22
default_install_hook_types: ["pre-commit", "pre-push"]
3-
default_stages: ["commit", "push"]
3+
default_stages: ["pre-commit", "pre-push"]
44
minimum_pre_commit_version: 2.18.0
55
repos:
6+
# Linting
7+
- repo: local
8+
hooks:
9+
- id: prettier
10+
name: Prettier
11+
entry: prettier --write --ignore-unknown
12+
language: node
13+
types: [text]
14+
args: []
15+
# https://github.com/prettier/prettier/releases
16+
additional_dependencies: ["[email protected]"]
17+
stages: ["pre-commit"]
618
# Security
719
- repo: https://github.com/Yelp/detect-secrets
820
rev: v1.5.0
921
hooks:
1022
- id: detect-secrets
1123
- repo: https://github.com/gitleaks/gitleaks
12-
rev: v8.18.4
24+
rev: v8.22.1
1325
hooks:
1426
- id: gitleaks
1527
- repo: https://github.com/fabasoad/pre-commit-grype
16-
rev: v0.6.0
28+
rev: v0.6.1
1729
hooks:
1830
- id: grype-dir
1931
args:
2032
- --grype-args=--by-cve --fail-on=low
2133
- --hook-args=--log-level debug
22-
stages: ["push"]
34+
stages: ["pre-push"]
2335
# Markdown
2436
- repo: https://github.com/igorshubovych/markdownlint-cli
25-
rev: v0.41.0
37+
rev: v0.43.0
2638
hooks:
2739
- id: markdownlint-fix
28-
stages: ["commit"]
40+
stages: ["pre-commit"]
2941
# Shell
3042
- repo: https://github.com/openstack/bashate
3143
rev: 2.1.1
3244
hooks:
3345
- id: bashate
3446
args: ["-i", "E003,E006"]
35-
stages: ["commit"]
47+
stages: ["pre-commit"]
3648
# Yaml
3749
- repo: https://github.com/adrienverge/yamllint
3850
rev: v1.35.1
3951
hooks:
4052
- id: yamllint
41-
stages: ["push"]
53+
stages: ["pre-push"]
4254
# GitHub Actions
4355
- repo: https://github.com/rhysd/actionlint
44-
rev: v1.7.1
56+
rev: v1.7.6
4557
hooks:
4658
- id: actionlint
4759
args: ["-pyflakes="]
48-
stages: ["commit"]
60+
stages: ["pre-commit"]
4961
# Other
50-
- repo: https://github.com/pre-commit/mirrors-prettier
51-
rev: v3.1.0
52-
hooks:
53-
- id: prettier
54-
stages: ["commit"]
5562
- repo: https://github.com/pre-commit/pre-commit-hooks
56-
rev: v4.6.0
63+
rev: v5.0.0
5764
hooks:
5865
- id: check-executables-have-shebangs
59-
stages: ["commit"]
66+
stages: ["pre-commit"]
6067
- id: check-shebang-scripts-are-executable
61-
stages: ["commit"]
68+
stages: ["pre-commit"]
6269
- id: check-merge-conflict
6370
- id: check-json
64-
stages: ["push"]
71+
stages: ["pre-push"]
6572
- id: detect-private-key
6673
- id: end-of-file-fixer
6774
- id: mixed-line-ending
6875
args: ["--fix=lf"]
6976
- id: no-commit-to-branch
70-
stages: ["commit"]
77+
stages: ["pre-commit"]
7178
- id: trailing-whitespace

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020-2024 Yevhen Fabizhevskyi
3+
Copyright (c) 2020-2025 Yevhen Fabizhevskyi
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,41 @@
22

33
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)
44
![GitHub release](https://img.shields.io/github/v/release/fabasoad/setup-cobol-action?include_prereleases)
5-
![functional-tests-local](https://github.com/fabasoad/setup-cobol-action/actions/workflows/functional-tests-local.yml/badge.svg)
6-
![functional-tests-remote](https://github.com/fabasoad/setup-cobol-action/actions/workflows/functional-tests-remote.yml/badge.svg)
5+
![functional-tests](https://github.com/fabasoad/setup-cobol-action/actions/workflows/functional-tests.yml/badge.svg)
76
![security](https://github.com/fabasoad/setup-cobol-action/actions/workflows/security.yml/badge.svg)
87
![linting](https://github.com/fabasoad/setup-cobol-action/actions/workflows/linting.yml/badge.svg)
98

109
This action sets up a [GnuCOBOL](https://en.wikipedia.org/wiki/COBOL) programming
1110
language.
1211

13-
Supported OS: Linux Ubuntu.
12+
## Supported OS
13+
14+
<!-- prettier-ignore-start -->
15+
| OS | |
16+
|---------|--------------------|
17+
| Windows | :x: |
18+
| Linux | :white_check_mark: |
19+
| macOS | :x: |
20+
<!-- prettier-ignore-end -->
1421

1522
## Inputs
1623

24+
```yaml
25+
- uses: fabasoad/setup-cobol-action@v1
26+
with:
27+
# (Optional) GnuCOBOL version. Defaults to 3.2.
28+
version: "3.2"
29+
# (Optional) If "true" it installs cobc even if it is already installed on a
30+
# runner. Otherwise, skips installation.
31+
force: "false"
32+
```
33+
34+
## Outputs
35+
1736
<!-- prettier-ignore-start -->
18-
| Name | Required | Description | Default | Possible values |
19-
|---------|----------|-------------------|---------|----------------------------------------|
20-
| version | No | GnuCOBOL version. | `3.1.2` | `3.0-rc1`, `3.1-rc1`, `3.1.1`, `3.1.2` |
37+
| Name | Description | Example |
38+
|-----------|-----------------------------------|---------|
39+
| installed | Whether cobc was installed or not | `true` |
2140
<!-- prettier-ignore-end -->
2241

2342
## Example usage
@@ -34,8 +53,8 @@ jobs:
3453
name: Setup
3554
runs-on: ubuntu-latest
3655
steps:
37-
- uses: actions/checkout@main
38-
- uses: fabasoad/setup-cobol-action@main
56+
- uses: actions/checkout@v4
57+
- uses: fabasoad/setup-cobol-action@v1
3958
- name: Run script
4059
run: |
4160
cobc -x HelloWorld.cob

0 commit comments

Comments
 (0)