Skip to content

Commit

Permalink
Transform action from 'javascript' to 'composite' (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabasoad authored Nov 25, 2022
1 parent dfcb1b3 commit 432221e
Show file tree
Hide file tree
Showing 19 changed files with 50 additions and 2,591 deletions.
35 changes: 0 additions & 35 deletions .eslintrc.json

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/functional-tests-local.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
name: Functional Tests (Local)

on:
pull_request:
on: [pull_request]

jobs:
run-script:
Expand All @@ -15,7 +14,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
- name: Setup COBOL
uses: ./
with:
version: ${{ matrix.version }}
- name: Validate script
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/functional-tests-remote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
push:
branches:
- 'main'
pull_request:

jobs:
run-script:
Expand All @@ -17,7 +16,8 @@ jobs:
version: ['3.1.2', '3.0-rc1', '3.1-rc1', '3.1.1']
runs-on: ubuntu-latest
steps:
- uses: fabasoad/setup-cobol-action@rollback-to-1.1.0
- name: Setup COBOL
uses: fabasoad/setup-cobol-action@main
with:
version: ${{ matrix.version }}
- name: Prepare script
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/security-tests.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/unit-tests.yml

This file was deleted.

1 change: 0 additions & 1 deletion .markdownlintignore

This file was deleted.

9 changes: 0 additions & 9 deletions .nycrc.json

This file was deleted.

32 changes: 1 addition & 31 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
---
default_stages: ["commit"]
exclude: ^(\.gitleaks\.toml|dist/.*\.js|coverage/.*)$
exclude: ^\.gitleaks\.toml$
repos:
- repo: local
hooks:
- id: build
name: Build
entry: yarn run build
language: system
pass_filenames: false
verbose: true
- id: test
name: Unit tests
entry: yarn test
language: system
pass_filenames: false
verbose: true
stages: ["push"]
# Security
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
Expand All @@ -28,20 +13,6 @@ repos:
hooks:
- id: gitleaks
stages: ["commit", "push"]
- repo: https://github.com/fabasoad/pre-commit-snyk
rev: v0.2.0
hooks:
- id: snyk-test
stages: ["push"]
# TypeScript
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.28.0
hooks:
- id: eslint
args: ['--fix']
files: \.[jt]sx?$
types: [file]
exclude: ^dist/.*\.js$
# Markdown
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.32.2
Expand Down Expand Up @@ -73,4 +44,3 @@ repos:
- id: trailing-whitespace
ci:
autofix_prs: false
skip: [build, eslint, test]
2 changes: 1 addition & 1 deletion .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ extends: default

rules:
line-length:
max: 165
max: 185
level: error
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# Setup COBOL (GnuCOBOL)

![GitHub release](https://img.shields.io/github/v/release/fabasoad/setup-cobol-action?include_prereleases)
![Unit Tests](https://github.com/fabasoad/setup-cobol-action/workflows/Unit%20Tests/badge.svg)
![Functional Tests](https://github.com/fabasoad/setup-cobol-action/workflows/Functional%20Tests%20(Remote)/badge.svg)
![Security Tests](https://github.com/fabasoad/setup-cobol-action/workflows/Security%20Tests/badge.svg)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/fabasoad/setup-cobol-action/main.svg)](https://results.pre-commit.ci/latest/github/fabasoad/setup-cobol-action/main)
[![Maintainability](https://api.codeclimate.com/v1/badges/84d9008a0dc1a2c6f703/maintainability)](https://codeclimate.com/github/fabasoad/setup-cobol-action/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/84d9008a0dc1a2c6f703/test_coverage)](https://codeclimate.com/github/fabasoad/setup-cobol-action/test_coverage)
[![Known Vulnerabilities](https://snyk.io/test/github/fabasoad/setup-cobol-action/badge.svg?targetFile=package.json)](https://snyk.io/test/github/fabasoad/setup-cobol-action?targetFile=package.json)

This action sets up a [GnuCOBOL](https://en.wikipedia.org/wiki/COBOL) programming
language.
Expand Down
113 changes: 0 additions & 113 deletions __tests__/test-installer.js

This file was deleted.

45 changes: 43 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,46 @@ inputs:
required: false
default: '3.1.2'
runs:
using: 'node16'
main: 'dist/index.js'
using: 'composite'
steps:
- name: Fail
uses: actions/github-script@v6
if: ${{ runner.os != 'Linux' }}
with:
script: core.setFailed('${{ runner.os }} ${{ runner.arch }} is not supported');
- name: Collect info
id: info
if: ${{ runner.os == 'Linux' }}
run: |
COBOL_INSTALLED=$(if command -v cobc >/dev/null 2>&1; then echo true; else echo false; fi)
echo "COBOL_INSTALLED=$COBOL_INSTALLED" >> $GITHUB_OUTPUT
mkdir -p "$GITHUB_WORKSPACE/cobol"
echo "COBOL_PATH=$GITHUB_WORKSPACE/cobol" >> $GITHUB_OUTPUT
shell: sh
- name: Install COBOL
if: ${{ runner.os == 'Linux' && steps.info.outputs.COBOL_INSTALLED == 'false' }}
env:
CURL_VERSION: 7.81.0-1ubuntu1.6
TAR_VERSION: 1.34+dfsg-1build3
LIBNCURSES5_DEV_VERSION: 6.3-2
LIBGMP_DEV_VERSION: 2:6.2.1+dfsg-3ubuntu1
LIBDB_DEV_VERSION: 1:5.3.21~exp1ubuntu4
IPROUTE2_VERSION: 5.15.0-1ubuntu2
RANGER_VERSION: 1.9.3-3ubuntu1
AUTOCONF_VERSION: 2.71-2
BUILD_ESSENTIAL_VERSION: 12.9ubuntu3
run: |
sudo apt-get update
sudo apt-get -y install curl tar libncurses5-dev libgmp-dev libdb-dev
sudo apt-get -y autoremove
sudo apt-get -y install iproute2
# download and install open-cobol for depencies (libcob >= 4.0)
sudo apt-get -y install ranger autoconf build-essential
curl -sLk https://sourceforge.net/projects/open-cobol/files/gnu-cobol/"$(echo "${{ inputs.version }}" | cut -b1- | cut -b-3)"/gnucobol-"${{ inputs.version }}".tar.gz | tar xz
cd gnucobol-"${{ inputs.version }}" && ./configure --prefix=/usr && sudo make && sudo make install && sudo ldconfig && cd /tmp/ && sudo rm -rf ./*
sudo apt-get -y --purge autoremove
echo "/home/cobol" >> $GITHUB_PATH
shell: sh
working-directory: ${{ steps.info.outputs.COBOL_PATH }}
3 changes: 0 additions & 3 deletions dist/index.js

This file was deleted.

Loading

0 comments on commit 432221e

Please sign in to comment.