Skip to content

Commit 51c0389

Browse files
Copilotandreasabel
andcommitted
Fix archive naming and simplify extraction logic
Co-authored-by: andreasabel <1155218+andreasabel@users.noreply.github.com>
1 parent 930ad4b commit 51c0389

File tree

2 files changed

+104
-25
lines changed

2 files changed

+104
-25
lines changed

.github/workflows/test.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Test Action
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- 'copilot/**'
9+
pull_request:
10+
workflow_dispatch:
11+
12+
jobs:
13+
test-linux:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Agda
20+
id: setup
21+
uses: ./
22+
with:
23+
agda-version: '2.8.0'
24+
agda-stdlib-version: '2.3'
25+
26+
- name: Verify Agda installation
27+
run: |
28+
echo "Agda path: ${{ steps.setup.outputs.agda-path }}"
29+
echo "Agda dir: ${{ steps.setup.outputs.agda-dir }}"
30+
agda --version
31+
32+
- name: Create test file
33+
run: |
34+
cat > test.agda << 'EOF'
35+
module test where
36+
37+
data Bool : Set where
38+
true false : Bool
39+
EOF
40+
41+
- name: Test Agda
42+
run: agda test.agda
43+
44+
test-windows:
45+
runs-on: windows-latest
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v4
49+
50+
- name: Setup Agda
51+
id: setup
52+
uses: ./
53+
with:
54+
agda-version: '2.8.0'
55+
56+
- name: Verify Agda installation
57+
run: |
58+
echo "Agda path: ${{ steps.setup.outputs.agda-path }}"
59+
echo "Agda dir: ${{ steps.setup.outputs.agda-dir }}"
60+
agda --version
61+
62+
test-macos:
63+
runs-on: macos-latest
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v4
67+
68+
- name: Setup Agda
69+
id: setup
70+
uses: ./
71+
with:
72+
agda-version: '2.8.0'
73+
agda-stdlib-version: '2.3'
74+
75+
- name: Verify Agda installation
76+
run: |
77+
echo "Agda path: ${{ steps.setup.outputs.agda-path }}"
78+
echo "Agda dir: ${{ steps.setup.outputs.agda-dir }}"
79+
agda --version
80+
81+
test-macos-intel:
82+
runs-on: macos-13 # Intel-based macOS
83+
steps:
84+
- name: Checkout
85+
uses: actions/checkout@v4
86+
87+
- name: Setup Agda
88+
id: setup
89+
uses: ./
90+
with:
91+
agda-version: '2.8.0'
92+
93+
- name: Verify Agda installation
94+
run: |
95+
echo "Agda path: ${{ steps.setup.outputs.agda-path }}"
96+
echo "Agda dir: ${{ steps.setup.outputs.agda-dir }}"
97+
agda --version

action.yml

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ runs:
3535
Windows)
3636
echo "os=windows"
3737
echo "archive-ext=zip"
38-
echo "archive-name=Agda-v${{ inputs.agda-version }}-windows.zip"
38+
echo "archive-name=Agda-v${{ inputs.agda-version }}-win64.zip"
3939
;;
4040
macOS)
4141
# Determine if we're on Intel or ARM
4242
if [[ "${{ runner.arch }}" == "X64" ]]; then
43-
echo "os=macos-intel"
43+
echo "os=macos-x64"
4444
echo "archive-ext=tar.xz"
45-
echo "archive-name=Agda-v${{ inputs.agda-version }}-macos-intel.tar.xz"
45+
echo "archive-name=Agda-v${{ inputs.agda-version }}-macOS-x64.tar.xz"
4646
else
47-
echo "os=macos"
47+
echo "os=macos-arm64"
4848
echo "archive-ext=tar.xz"
49-
echo "archive-name=Agda-v${{ inputs.agda-version }}-macos.tar.xz"
49+
echo "archive-name=Agda-v${{ inputs.agda-version }}-macOS-arm64.tar.xz"
5050
fi
5151
;;
5252
*)
@@ -90,15 +90,7 @@ runs:
9090
shell: bash
9191
run: |
9292
mkdir -p "${HOME}/.local/bin/"
93-
if [[ -f "agda" ]]; then
94-
mv agda "${HOME}/.local/bin/"
95-
elif [[ -f "bin/agda" ]]; then
96-
mv bin/agda "${HOME}/.local/bin/"
97-
else
98-
echo "Could not find agda executable in archive"
99-
ls -la
100-
exit 1
101-
fi
93+
mv agda "${HOME}/.local/bin/"
10294
echo "${HOME}/.local/bin" >> "${GITHUB_PATH}"
10395
10496
- name: Install Agda (Windows)
@@ -107,17 +99,7 @@ runs:
10799
run: |
108100
$installPath = Join-Path $env:USERPROFILE ".local\bin"
109101
New-Item -ItemType Directory -Force -Path $installPath | Out-Null
110-
111-
if (Test-Path "agda.exe") {
112-
Move-Item -Path "agda.exe" -Destination $installPath -Force
113-
} elseif (Test-Path "bin\agda.exe") {
114-
Move-Item -Path "bin\agda.exe" -Destination $installPath -Force
115-
} else {
116-
Write-Error "Could not find agda.exe in archive"
117-
Get-ChildItem -Recurse
118-
exit 1
119-
}
120-
102+
Move-Item -Path "agda.exe" -Destination $installPath -Force
121103
"$installPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
122104
123105
- name: Setup Agda directories

0 commit comments

Comments
 (0)