Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump actionlint from 1.7.4 to 1.7.5 #21

Merged
merged 40 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3547bf7
Bump actionlint from 1.7.4 to 1.7.5
fabasoad Dec 29, 2024
cf370b1
Fix dir name
fabasoad Dec 30, 2024
0beee93
Fix getting releases
fabasoad Dec 30, 2024
6c4af96
Fix tests 1
fabasoad Dec 30, 2024
cb9c8b1
Fix tests 2
fabasoad Dec 30, 2024
0cdc9c1
Fix tests 3
fabasoad Dec 30, 2024
bc3aa58
Fix tests 4
fabasoad Dec 30, 2024
ddfa1ad
Fix tests 5
fabasoad Dec 30, 2024
7c6bc1b
Fix tests 6
fabasoad Dec 30, 2024
cbb64b8
Fix tests 7
fabasoad Dec 30, 2024
89e0e85
Fix tests 8
fabasoad Dec 30, 2024
cee75e3
Fix tests 9
fabasoad Dec 30, 2024
7ce035b
Fix tests 10
fabasoad Dec 30, 2024
1a0eb3e
Fix tests 11
fabasoad Dec 30, 2024
4083456
Fix tests 12
fabasoad Dec 30, 2024
6137c4f
Fix tests 13
fabasoad Dec 30, 2024
d600b4b
Fix tests 14
fabasoad Dec 30, 2024
2b5ec1e
Fix tests 15
fabasoad Dec 30, 2024
1917f69
Fix tests 16
fabasoad Dec 30, 2024
fce8280
Fix tests 17
fabasoad Dec 30, 2024
26ac50d
Fix tests 18
fabasoad Dec 30, 2024
fff2a2c
Fix tests 19
fabasoad Dec 30, 2024
9107515
Fix tests 20
fabasoad Dec 30, 2024
0d5c944
Fix tests 21
fabasoad Dec 30, 2024
f0e4eee
Fix tests 22
fabasoad Dec 30, 2024
e8aa068
Fix tests 23
fabasoad Dec 30, 2024
301413c
Fix tests 24
fabasoad Dec 30, 2024
38fdbcb
Fix tests 25
fabasoad Dec 30, 2024
1a092b5
Fix tests 26
fabasoad Dec 30, 2024
d008da9
Fix tests 27
fabasoad Dec 30, 2024
843cc40
Fix tests 28
fabasoad Dec 30, 2024
5564f7f
Fix tests 29
fabasoad Dec 30, 2024
6462806
Fix tests 30
fabasoad Dec 30, 2024
f4e6b1e
Fix tests 31
fabasoad Dec 30, 2024
cb2aaca
Fix tests 32
fabasoad Dec 30, 2024
8d6159a
Fix tests 33
fabasoad Dec 30, 2024
c9195ec
Fix tests 34
fabasoad Dec 30, 2024
18981ce
Fix tests 35
fabasoad Dec 30, 2024
3221fda
Fix tests 36
fabasoad Dec 30, 2024
3611faf
Add prefix
fabasoad Dec 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 84 additions & 5 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,113 @@ defaults:

jobs:
get-versions:
name: Get 5 latest versions
name: Get 3 latest versions
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
versions: ${{ steps.prepare-list.outputs.versions }}
steps:
- name: Prepare list
id: prepare-list
env:
RELEASES_AMOUNT: "3"
TARGET_REPO: "ciao-lang/ciao"
run: |
url="https://api.github.com/repos/ciao-lang/ciao/releases"
versions=$(curl -s "${url}" | jq -c '[.[0:5][].tag_name] | map(sub("^v"; ""))')
versions=$(curl -sL \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${TARGET_REPO}/releases" \
| jq -c -r --arg n "${RELEASES_AMOUNT}" '[.[0:($n | tonumber)][].tag_name] | map(sub("^v"; "")) | . += ["latest"]')
echo "versions=${versions}" >> "$GITHUB_OUTPUT"
setup-ciao:
name: Setup Ciao
needs: [get-versions]
timeout-minutes: 10
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
os: ["ubuntu", "macos"]
version: ${{ fromJSON(needs.get-versions.outputs.versions) }}
runs-on: ${{ matrix.os }}-latest
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
- name: Setup Ciao
id: setup-ciao
uses: ./
with:
version: ${{ matrix.version }}
- name: Test action completion
run: |
test_equal() {
if [ "${2}" != "${3}" ]; then
echo "::error title=${1}::Expected: ${3}. Actual: ${2}."
exit 1
fi
}
test_equal "Wrong completion status" \
"${{ steps.setup-ciao.outcome }}" \
"success"
test_equal "ciao should not be installed" \
"${{ steps.setup-ciao.outputs.installed }}" \
"true"
- name: Run command
run: ciao list
windows-not-supported:
name: Windows not supported
runs-on: windows-latest
timeout-minutes: 5
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
- name: Setup Ciao
id: setup-ciao
continue-on-error: true
uses: ./
- name: Test action completion
run: |
test_equal() {
if [ "${2}" != "${3}" ]; then
echo "::error title=${1}::Expected: ${3}. Actual: ${2}."
exit 1
fi
}
test_equal "Wrong completion status" \
"${{ steps.setup-ciao.outcome }}" \
"failure"
test_equal "ciao should not be installed" \
"${{ steps.setup-ciao.outputs.installed }}" \
"false"
test-force:
name: Test force
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
force: ["true", "false"]
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
- name: Setup Ciao 1
id: setup-ciao-1
uses: ./
- name: Setup Ciao 2
id: setup-ciao-2
uses: ./
with:
force: ${{ matrix.force }}
- name: Test action completion
run: |
test_equal() {
if [ "${2}" != "${3}" ]; then
echo "::error title=${1}::Expected: ${3}. Actual: ${2}."
exit 1
fi
}
test_equal "Wrong \"installed\" output from setup-ciao-1" \
"${{ steps.setup-ciao-1.outputs.installed }}" \
"true"
test_equal "Wrong \"installed\" output from setup-ciao-2" \
"${{ steps.setup-ciao-2.outputs.installed }}" \
"${{ matrix.force }}"
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ repos:
stages: ["pre-push"]
# GitHub Actions
- repo: https://github.com/rhysd/actionlint
rev: v1.7.4
rev: v1.7.5
hooks:
- id: actionlint
args: ["-pyflakes="]
Expand Down
35 changes: 29 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,38 @@

This action installs [Ciao](http://ciao-lang.org) CLI tool.

Supported OS: Linux and macOS.
## Supported OS

<!-- prettier-ignore-start -->
| OS | |
|---------|--------------------|
| Windows | :x: |
| Linux | :white_check_mark: |
| macOS | :white_check_mark: |
<!-- prettier-ignore-end -->

## Prerequisites

None.

## Inputs

```yaml
- uses: fabasoad/setup-ciao-action@v0
with:
# (Optional) Ciao version. Defaults to the latest version.
version: "1.24.0-m1"
# (Optional) If "false" skips installation if ciao is already installed. If
# "true" installs ciao in any case. Defaults to "false".
force: "false"
```

## Outputs

<!-- prettier-ignore-start -->
| Name | Required | Description | Default | Possible values |
|---------|----------|---------------------------------------------------------------------------------------------|-------------|-----------------|
| version | No | Version of `Ciao` tool that can be found [here](https://github.com/ciao-lang/ciao/releases) | `1.24.0-m1` | &lt;String&gt; |
| Name | Description | Example |
|-----------|-----------------------------------|---------|
| installed | Whether ciao was installed or not | `true` |
<!-- prettier-ignore-end -->

## Example usage
Expand All @@ -32,8 +56,7 @@ jobs:
name: Ciao
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: fabasoad/setup-ciao-action@main
- uses: fabasoad/setup-ciao-action@v0
- name: Run command
run: ciao list
```
Expand Down
52 changes: 37 additions & 15 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,59 @@ branding:
color: gray-dark
inputs:
version:
description: "Ciao version."
description: Ciao version. Defaults to the latest version.
required: false
default: "1.24.0-m1"
default: "latest"
force:
description: |
If "false" skips installation if ciao is already installed. If "true"
installs ciao in any case. Defaults to "false".
required: false
default: "false"
outputs:
installed:
description: Whether ciao was installed or not.
value: "${{ steps.install-ciao.outcome == 'success' }}"
runs:
using: "composite"
steps:
- name: Fail
if: ${{ runner.os == 'Windows' }}
run: echo "::error::${RUNNER_OS} ${RUNNER_ARCH} is not supported" && exit 1
run: |
echo "::error title=OS is not supported::${RUNNER_OS} ${RUNNER_ARCH} is not supported"
exit 1
shell: sh
- name: Collect info
id: info
env:
INPUT_FORCE: "${{ inputs.force }}"
run: |
ciao_installed=$(if command -v ciao >/dev/null 2>&1; then echo true; else echo false; fi)
echo "ciao-installed=${ciao_installed}" >> "$GITHUB_OUTPUT"
bin_path="${GITHUB_WORKSPACE}/ciao"
mkdir -p "${bin_path}"
echo "ciao-path=${bin_path}" >> "$GITHUB_OUTPUT"
if [ "${INPUT_FORCE}" = "false" ] && command -v ciao >/dev/null 2>&1; then
bin_installed="true"
else
bin_installed="false"
fi
echo "bin-installed=${bin_installed}" >> "$GITHUB_OUTPUT"

bin_dir="ciao_$(date +%s)"
echo "bin-dir=${bin_dir}" >> "$GITHUB_OUTPUT"

bin_path="$GITHUB_WORKSPACE/${bin_dir}"
echo "bin-path=${bin_path}" >> "$GITHUB_OUTPUT"
shell: sh
- name: Download Ciao
if: ${{ steps.info.outputs.ciao-installed == 'false' }}
if: ${{ steps.info.outputs.bin-installed == 'false' }}
uses: actions/checkout@v4
with:
repository: ciao-lang/ciao
ref: v${{ inputs.version }}
repository: "ciao-lang/ciao"
ref: ${{ inputs.version == 'latest' && 'master' || format('v{0}', inputs.version) }}
fetch-depth: 1
path: ciao
path: ${{ steps.info.outputs.bin-dir }}
- name: Install Ciao
if: ${{ steps.info.outputs.ciao-installed == 'false' }}
if: ${{ steps.info.outputs.bin-installed == 'false' }}
id: install-ciao
run: |
./ciao-boot.sh local-install
echo "${{ steps.info.outputs.ciao-path }}/build/bin" >> "$GITHUB_PATH"
echo "$(pwd)/build/bin" >> "$GITHUB_PATH"
shell: sh
working-directory: ${{ steps.info.outputs.ciao-path }}
working-directory: "${{ steps.info.outputs.bin-path }}"
Loading