Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 42 additions & 0 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Example Usage

on: [push, pull_request]

permissions:
contents: read

jobs:
example:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Setup Agda
id: setup-agda
uses: agda/agda-setup-action@v1
with:
agda-version: '2.8.0'
agda-stdlib-version: '2.3'

- name: Show Agda info
run: |
echo "Agda path: ${{ steps.setup-agda.outputs.agda-path }}"
echo "Agda dir: ${{ steps.setup-agda.outputs.agda-dir }}"
agda --version

- name: Create a simple Agda file
run: |
cat > Example.agda << 'EOF'
module Example where

open import Data.Bool.Base
open import Data.Nat.Base

example : Bool
example = true
EOF

- name: Type-check Agda file
run: agda Example.agda
59 changes: 59 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test Action

on:
push:
branches:
- main
- master
- 'copilot/**'
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
include:
- os: ubuntu-latest
agda-stdlib-version: '2.3'
- os: windows-latest
agda-stdlib-version: ''
- os: macos-latest
agda-stdlib-version: '2.3'
- os: macos-13
agda-stdlib-version: ''
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Agda
id: setup
uses: ./
with:
agda-version: '2.8.0'
agda-stdlib-version: ${{ matrix.agda-stdlib-version }}

- name: Verify Agda installation
run: |
echo "Agda path: ${{ steps.setup.outputs.agda-path }}"
echo "Agda dir: ${{ steps.setup.outputs.agda-dir }}"
agda --version

- name: Create test file
if: matrix.os == 'ubuntu-latest'
run: |
cat > test.agda << 'EOF'
module test where

data Bool : Set where
true false : Bool
EOF

- name: Test Agda
if: matrix.os == 'ubuntu-latest'
run: agda test.agda
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Temporary files
*.tmp
*.temp
/tmp/

# Archive files used during testing
*.tar.xz
*.tar.gz
*.zip

# Agda build artifacts
*.agdai
_build/

# OS files
.DS_Store
Thumbs.db

# IDE files
.vscode/
.idea/
*.swp
*.swo
*~
103 changes: 102 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,103 @@
# agda-setup-action
Github action to install Agda from the official deployed binaries

GitHub composite action to install Agda from the official deployed binaries and optionally the Agda standard library.

## Features

- Installs Agda from official GitHub releases.
- Optional installation of the Agda standard library.
- Cross-platform support:
- Ubuntu (latest)
- Windows (latest)
- macOS (latest, including macOS-15-intel)
- Outputs the path to the Agda executable and Agda application directory.

## Usage

### Basic Usage (Agda only)

```yaml
- name: Setup Agda
uses: agda/agda-setup-action@v1
with:
agda-version: '2.8.0'
```

### With Standard Library

```yaml
- name: Setup Agda with stdlib
uses: agda/agda-setup-action@v1
with:
agda-version: '2.8.0'
agda-stdlib-version: '2.3'
```

### Using Outputs

```yaml
- name: Setup Agda
id: setup-agda
uses: agda/agda-setup-action@v1
with:
agda-version: '2.8.0'
agda-stdlib-version: '2.3'

- name: Use Agda
run: |
echo "Agda path: ${{ steps.setup-agda.outputs.agda-path }}"
echo "Agda dir: ${{ steps.setup-agda.outputs.agda-dir }}"
agda --version
```

## Inputs

| Name | Description | Required | Default |
|------|-------------|----------|---------|
| `agda-version` | Version of Agda to install (e.g., `2.8.0`) | Yes | - |
| `agda-stdlib-version` | Version of Agda standard library to install (e.g., `2.3`). If not specified, stdlib will not be installed. | No | `''` |

## Outputs

| Name | Description |
|------|-------------|
| `agda-path` | Path to the Agda executable |
| `agda-dir` | Path to the Agda application directory |

## Example Workflow

```yaml
name: Build with Agda

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5

- name: Setup Agda
uses: agda/agda-setup-action@v1
with:
agda-version: '2.8.0'
agda-stdlib-version: '2.3'

- name: Build Agda files
run: agda Main.agda
```

## Platform Support

This action supports the following platforms:
- `ubuntu-latest`
- `windows-latest`
- `macos-latest`
- `macos-15-intel`

The action automatically detects the platform and downloads the appropriate binary for your runner.

## License

This project is licensed under the same terms as Agda itself.
Loading
Loading