2021-10-27 11:20:25 +00:00
|
|
|
name: Tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
name: Test metadata
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
env:
|
|
|
|
YAML_VER: 0.0.6
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-10-27 13:04:49 +00:00
|
|
|
ghc:
|
|
|
|
- '8.10.7'
|
|
|
|
cabal:
|
|
|
|
- '3.6.2.0'
|
2021-10-27 11:20:25 +00:00
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- uses: haskell/actions/setup@v1.2
|
|
|
|
with:
|
2021-10-27 13:04:49 +00:00
|
|
|
ghc-version: ${{ matrix.ghc }}
|
|
|
|
cabal-version: ${{ matrix.cabal }}
|
|
|
|
|
|
|
|
- name: Cache Cabal
|
|
|
|
uses: actions/cache@v2
|
|
|
|
env:
|
|
|
|
cache-name: cache-cabal
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cabal/store
|
|
|
|
~/.cabal/packages
|
|
|
|
key: v2-${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-build-${{ hashFiles('cabal.project') }}
|
|
|
|
restore-keys: |
|
|
|
|
v2-${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-build-${{ hashFiles('cabal.project') }}
|
|
|
|
v2-${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-build-
|
|
|
|
v2-${{ runner.os }}-${{ matrix.ghc }}
|
2021-10-27 11:20:25 +00:00
|
|
|
|
|
|
|
- name: create ~/.local/bin
|
|
|
|
run: mkdir -p "$HOME/.local/bin"
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Add ~/.local/bin to PATH
|
|
|
|
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Update cabal cache
|
|
|
|
run: cabal update
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Install ghcup-gen
|
|
|
|
run: |
|
2021-10-27 13:04:49 +00:00
|
|
|
cabal install --installdir="$HOME/.local/bin" --overwrite-policy=always --install-method=copy ghcup-gen
|
2021-10-27 11:20:25 +00:00
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Check
|
|
|
|
run: |
|
|
|
|
ghcup-gen -- check -f ghcup-${{ env.YAML_VER }}.yaml
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Check tarballs
|
|
|
|
run: |
|
|
|
|
ghcup-gen -- check-tarballs -f ghcup-${{ env.YAML_VER }}.yaml -u 'ghcup-.*'
|
|
|
|
shell: bash
|