Skip to content

Commit 7ba9435

Browse files
authored
Add basic CI (#2)
1 parent 3493724 commit 7ba9435

File tree

6 files changed

+44
-1
lines changed

6 files changed

+44
-1
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
if: ${{ github.repository == 'codewars/agda' }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: docker/setup-buildx-action@v2
15+
16+
- name: Build image
17+
uses: docker/build-push-action@v3
18+
with:
19+
context: .
20+
push: false
21+
# Make the image available in next step
22+
load: true
23+
tags: ghcr.io/codewars/agda:latest
24+
cache-from: type=gha
25+
cache-to: type=gha,mode=max
26+
27+
- name: Run Passing Example
28+
run: bin/run passing
29+
- name: Run Failing Example
30+
run: bin/run failing | grep 'b != a of type A'

bin/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ C=$(docker container create --rm -w $W ghcr.io/codewars/agda:latest agda --verbo
88
# Copy files from the current directory
99
# example/Example.agda
1010
# example/ExampleTest.agda
11-
docker container cp example/. $C:$W
11+
docker container cp examples/${1:-passing}/. $C:$W
1212

1313
# Run tests
1414
docker container start --attach $C

examples/failing/Example.agda

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{-# OPTIONS --safe #-}
2+
module Example where
3+
open import Agda.Builtin.Equality
4+
5+
_⇆_ : {A : Set} {a : A} a ≡ a a ≡ a a ≡ a
6+
refl ⇆ refl = refl
File renamed without changes.
File renamed without changes.

examples/passing/ExampleTest.agda

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{-# OPTIONS --safe #-}
2+
module ExampleTest where
3+
open import Agda.Builtin.Equality
4+
open import Example
5+
6+
check : {A : Set} {a b c : A} a ≡ b b ≡ c a ≡ c
7+
check = _⇆_

0 commit comments

Comments
 (0)