2022-08-09 18:13:54 +00:00
|
|
|
name: Bindist installation
|
2022-08-10 17:47:40 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
2022-08-09 18:13:54 +00:00
|
|
|
on:
|
2022-12-17 14:07:34 +00:00
|
|
|
pull_request:
|
|
|
|
types: [opened]
|
|
|
|
issue_comment:
|
|
|
|
types: [created]
|
2022-08-09 18:13:54 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
2022-09-15 14:25:22 +00:00
|
|
|
tool:
|
|
|
|
description: Tool
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
version:
|
|
|
|
description: Version
|
2022-08-09 18:13:54 +00:00
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
metadataFile:
|
|
|
|
description: Metadata file
|
|
|
|
required: true
|
|
|
|
default: ghcup-0.0.7.yaml
|
|
|
|
type: string
|
2022-08-11 01:27:55 +00:00
|
|
|
env:
|
|
|
|
BOOTSTRAP_HASKELL_NONINTERACTIVE: 1
|
|
|
|
BOOTSTRAP_HASKELL_MINIMAL: 1
|
|
|
|
BOOTSTRAP_HASKELL_ADJUST_BASHRC: 1
|
2022-09-15 14:25:22 +00:00
|
|
|
TOOL: ${{ github.event.inputs.tool }}
|
|
|
|
VERSION: ${{ github.event.inputs.version }}
|
2022-08-11 01:27:55 +00:00
|
|
|
METADATA_FILE: ${{ github.event.inputs.metadataFile }}
|
2022-08-09 18:13:54 +00:00
|
|
|
jobs:
|
|
|
|
bindist-install:
|
|
|
|
name: linux-${{ matrix.image }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- image: alpine:latest
|
|
|
|
installCmd: apk update && apk add
|
|
|
|
toolRequirements: binutils-gold curl gcc g++ gmp-dev libc-dev libffi-dev make musl-dev ncurses-dev perl tar xz
|
|
|
|
- image: debian:9
|
|
|
|
installCmd: apt-get update && apt-get install -y
|
|
|
|
toolRequirements: build-essential curl libffi-dev libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
|
|
|
|
- image: debian:10
|
|
|
|
installCmd: apt-get update && apt-get install -y
|
|
|
|
toolRequirements: build-essential curl libffi-dev libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
|
|
|
|
- image: debian:11
|
|
|
|
installCmd: apt-get update && apt-get install -y
|
|
|
|
toolRequirements: build-essential curl libffi-dev libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
|
2022-09-16 09:14:11 +00:00
|
|
|
- image: ubuntu:18.04
|
|
|
|
installCmd: apt-get update && apt-get install -y
|
2022-09-16 09:16:51 +00:00
|
|
|
toolRequirements: build-essential curl libffi-dev libffi6 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
|
2022-08-09 18:13:54 +00:00
|
|
|
- image: ubuntu:20.04
|
|
|
|
installCmd: apt-get update && apt-get install -y
|
|
|
|
toolRequirements: build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
|
|
|
|
- image: ubuntu:22.04
|
|
|
|
installCmd: apt-get update && apt-get install -y
|
|
|
|
toolRequirements: build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
|
|
|
|
- image: archlinux:latest
|
|
|
|
installCmd: pacman -Syu --noconfirm
|
2022-08-11 01:27:55 +00:00
|
|
|
toolRequirements: which gcc gmp libffi make ncurses perl tar xz
|
2022-12-14 14:37:23 +00:00
|
|
|
- image: fedora:36
|
2022-08-09 18:13:54 +00:00
|
|
|
installCmd: dnf install -y
|
2022-08-11 01:27:55 +00:00
|
|
|
toolRequirements: which gcc g++ gmp gmp-devel make ncurses ncurses-compat-libs xz perl
|
2022-10-08 13:37:57 +00:00
|
|
|
- image: linuxmintd/mint19.3-amd64
|
|
|
|
installCmd: apt-get update && apt-get install -y
|
|
|
|
toolRequirements: build-essential curl libffi-dev libffi6 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
|
|
|
|
- image: linuxmintd/mint20.2-amd64
|
|
|
|
installCmd: apt-get update && apt-get install -y
|
|
|
|
toolRequirements: build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
|
2022-08-09 18:13:54 +00:00
|
|
|
container:
|
|
|
|
image: ${{ matrix.image }}
|
|
|
|
steps:
|
|
|
|
- name: Install requirements
|
2022-08-10 17:47:40 +00:00
|
|
|
shell: sh
|
2022-08-09 18:13:54 +00:00
|
|
|
run: |
|
|
|
|
${{ matrix.installCmd }} curl bash git ${{ matrix.toolRequirements }}
|
2022-12-17 14:07:34 +00:00
|
|
|
|
|
|
|
- uses: shpingalet007/pull-request-comment-trigger@696de492b50cee0ba671934893c91c5805a403b9
|
|
|
|
id: check
|
|
|
|
with:
|
|
|
|
trigger: '@bindistTest ** ** **'
|
|
|
|
reaction: rocket
|
|
|
|
allow_arguments: true
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: '${{secrets.GITHUB_TOKEN}}'
|
|
|
|
|
|
|
|
- uses: shpingalet007/pull-request-comment-trigger@696de492b50cee0ba671934893c91c5805a403b9
|
|
|
|
id: checkRef
|
|
|
|
with:
|
|
|
|
trigger: '@bindistTestRef ** ** ** **'
|
|
|
|
reaction: rocket
|
|
|
|
allow_arguments: true
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: '${{secrets.GITHUB_TOKEN}}'
|
|
|
|
|
|
|
|
- if: ${{ steps.checkRef.outputs.triggered == 'true' }}
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ fromJson(steps.check.outputs.arguments)[3] }}
|
|
|
|
|
|
|
|
- if: ${{ steps.checkRef.outputs.triggered != 'true' }}
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- if: ${{ github.event_name != 'workflow_dispatch' || steps.check.outputs.triggered == 'true' }}
|
|
|
|
continue-on-error: true
|
|
|
|
name: Install ghcup and bindist
|
|
|
|
run: |
|
|
|
|
[ -z "${TOOL}" ] && export TOOL=${{ fromJson(steps.check.outputs.arguments)[0] }}
|
|
|
|
[ -z "${VERSION}" ] && export VERSION=${{ fromJson(steps.check.outputs.arguments)[1] }}
|
|
|
|
[ -z "${METADATA_FILE}" ] && export METADATA_FILE=${{ fromJson(steps.check.outputs.arguments)[2] }}
|
|
|
|
.github/workflows/install-bindist.sh
|
|
|
|
echo SUCCESS=true >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- if: ${{ github.event_name != 'workflow_dispatch' && steps.check.outputs.triggered != 'true' && steps.checkRef.outputs.triggered == 'true' }}
|
|
|
|
continue-on-error: true
|
|
|
|
name: Install ghcup and bindist
|
|
|
|
run: |
|
|
|
|
[ -z "${TOOL}" ] && export TOOL=${{ fromJson(steps.checkRef.outputs.arguments)[0] }}
|
|
|
|
[ -z "${VERSION}" ] && export VERSION=${{ fromJson(steps.checkRef.outputs.arguments)[1] }}
|
|
|
|
[ -z "${METADATA_FILE}" ] && export METADATA_FILE=${{ fromJson(steps.checkRef.outputs.arguments)[2] }}
|
|
|
|
.github/workflows/install-bindist.sh
|
|
|
|
echo SUCCESS=true >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
|
|
name: Install ghcup and bindist
|
|
|
|
run: |
|
|
|
|
.github/workflows/install-bindist.sh
|
|
|
|
echo SUCCESS=true >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- run: |
|
|
|
|
if [ "${{ env.SUCCESS }}" = "true" ] ; then
|
|
|
|
echo "true" > message-linux.txt
|
|
|
|
else
|
|
|
|
echo "false" > message-linux.txt
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: artifacts
|
|
|
|
path: |
|
|
|
|
./message-linux.txt
|
|
|
|
|
2022-08-10 17:47:40 +00:00
|
|
|
bindist-install-non-linux:
|
2022-08-09 18:13:54 +00:00
|
|
|
name: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- macos-11
|
|
|
|
- macos-12
|
2022-08-10 17:47:40 +00:00
|
|
|
- windows-latest
|
2022-08-09 18:13:54 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
2022-12-17 14:07:34 +00:00
|
|
|
- uses: shpingalet007/pull-request-comment-trigger@696de492b50cee0ba671934893c91c5805a403b9
|
|
|
|
id: check
|
|
|
|
with:
|
|
|
|
trigger: '@bindistTest ** ** **'
|
|
|
|
reaction: rocket
|
|
|
|
allow_arguments: true
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: '${{secrets.GITHUB_TOKEN}}'
|
|
|
|
|
|
|
|
- uses: shpingalet007/pull-request-comment-trigger@696de492b50cee0ba671934893c91c5805a403b9
|
|
|
|
id: checkRef
|
|
|
|
with:
|
|
|
|
trigger: '@bindistTestRef ** ** ** **'
|
|
|
|
reaction: rocket
|
|
|
|
allow_arguments: true
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: '${{secrets.GITHUB_TOKEN}}'
|
|
|
|
|
|
|
|
- if: ${{ steps.checkRef.outputs.triggered == 'true' }}
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
ref: ${{ fromJson(steps.check.outputs.arguments)[3] }}
|
|
|
|
|
|
|
|
- if: ${{ steps.checkRef.outputs.triggered != 'true' }}
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- if: ${{ github.event_name != 'workflow_dispatch' || steps.check.outputs.triggered == 'true' }}
|
|
|
|
continue-on-error: true
|
|
|
|
name: Install ghcup and bindist
|
|
|
|
run: |
|
|
|
|
[ -z "${TOOL}" ] && export TOOL=${{ fromJson(steps.check.outputs.arguments)[0] }}
|
|
|
|
[ -z "${VERSION}" ] && export VERSION=${{ fromJson(steps.check.outputs.arguments)[1] }}
|
|
|
|
[ -z "${METADATA_FILE}" ] && export METADATA_FILE=${{ fromJson(steps.check.outputs.arguments)[2] }}
|
|
|
|
.github/workflows/install-bindist.sh
|
|
|
|
echo SUCCESS=true >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- if: ${{ github.event_name != 'workflow_dispatch' && steps.check.outputs.triggered != 'true' && steps.checkRef.outputs.triggered == 'true' }}
|
|
|
|
continue-on-error: true
|
|
|
|
name: Install ghcup and bindist
|
|
|
|
run: |
|
|
|
|
[ -z "${TOOL}" ] && export TOOL=${{ fromJson(steps.checkRef.outputs.arguments)[0] }}
|
|
|
|
[ -z "${VERSION}" ] && export VERSION=${{ fromJson(steps.checkRef.outputs.arguments)[1] }}
|
|
|
|
[ -z "${METADATA_FILE}" ] && export METADATA_FILE=${{ fromJson(steps.checkRef.outputs.arguments)[2] }}
|
|
|
|
.github/workflows/install-bindist.sh
|
|
|
|
echo SUCCESS=true >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
|
|
name: Install ghcup and bindist
|
|
|
|
run: |
|
|
|
|
.github/workflows/install-bindist.sh
|
|
|
|
echo SUCCESS=true >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- run: |
|
|
|
|
if [ "${{ env.SUCCESS }}" = "true" ] ; then
|
|
|
|
echo "true" > message.txt
|
|
|
|
else
|
|
|
|
echo "false" > message.txt
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: artifacts
|
|
|
|
path: |
|
|
|
|
./message.txt
|
|
|
|
|
|
|
|
comment:
|
|
|
|
name: comment
|
|
|
|
needs: ["bindist-install", "bindist-install-non-linux"]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Download artifacts
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: artifacts
|
|
|
|
|
|
|
|
- run: |
|
|
|
|
if [ "$(cat message.txt)" == "true" ] && [ "$(cat message-linux.txt)" == "true" ] ; then
|
|
|
|
echo "SUCCESS=true" >> $GITHUB_ENV
|
|
|
|
else
|
|
|
|
echo "SUCCESS=false" >> $GITHUB_ENV
|
|
|
|
fi
|
|
|
|
|
|
|
|
- id: message
|
|
|
|
run: |
|
|
|
|
if [ "${{ env.SUCCESS }}" = "true" ] ; then
|
|
|
|
echo 'MESSAGE=Bindist check success :+1:' >> $GITHUB_OUTPUT
|
|
|
|
else
|
|
|
|
echo 'MESSAGE=Bindist check failure :-1:' >> $GITHUB_OUTPUT
|
|
|
|
fi
|
|
|
|
|
|
|
|
- if: ${{ github.event_name == 'pull_request' }}
|
|
|
|
name: Comment PR
|
|
|
|
uses: thollander/actions-comment-pull-request@v2
|
|
|
|
with:
|
|
|
|
message: |
|
|
|
|
${{ steps.message.outputs.MESSAGE }}
|
|
|
|
|
|
|
|
- name: Check on failures
|
|
|
|
if: env.SUCCESS != 'true'
|
|
|
|
run: exit 1
|
|
|
|
|