ghcup-metadata/.github/workflows/test.yaml

84 lines
2.2 KiB
YAML
Raw Normal View History

2021-10-27 11:20:25 +00:00
name: Tests
on:
push:
2022-09-15 11:58:05 +00:00
branches: [ master, develop ]
2021-10-27 11:20:25 +00:00
pull_request:
2022-09-15 11:58:05 +00:00
branches: [ master, develop ]
2021-10-27 11:20:25 +00:00
jobs:
test:
name: Test metadata
runs-on: ${{ matrix.os }}
env:
2023-01-11 13:54:34 +00:00
YAML_VER: 0.0.7
2021-10-27 11:20:25 +00:00
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:
2023-02-27 15:22:56 +00:00
- ubuntu-22.04
2021-10-27 11:20:25 +00:00
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
2023-01-11 13:54:34 +00:00
- name: install yamllint
run: pip install yamllint
2021-10-27 11:20:25 +00:00
- name: Update cabal cache
run: cabal update
shell: bash
2023-02-27 15:22:56 +00:00
- name: Install some deps
run: |
export DEBIAN_FRONTEND=noninteractive
export TZ=Asia/Singapore
sudo apt install -y libarchive-dev
shell: bash
2021-10-27 11:20:25 +00:00
- 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
2023-01-11 13:54:34 +00:00
- name: Check yaml
2021-10-27 11:20:25 +00:00
run: |
ghcup-gen -- check -f ghcup-${{ env.YAML_VER }}.yaml
2023-01-11 13:54:34 +00:00
yamllint ghcup-${{ env.YAML_VER }}.yaml
python3 -c "import yaml ; stream = open('ghcup-${{ env.YAML_VER }}.yaml', 'r') ; yaml.safe_load(stream)"
2021-10-27 11:20:25 +00:00
shell: bash
- name: Check tarballs
run: |
ghcup-gen -- check-tarballs -f ghcup-${{ env.YAML_VER }}.yaml -u 'ghcup-.*'
shell: bash