Create nydus-snapshotter.yml #384
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pull Request Build | |
on: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Set up Go 1.17 | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.17 | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Install hd | |
run: | | |
curl -L https://github.com/linuxsuren/http-downloader/releases/latest/download/hd-linux-amd64.tar.gz | tar xzv | |
sudo mv hd /usr/local/bin | |
hd version | |
# it'll run hd as sudo, so we just use the absolute path | |
sudo mkdir -p /root/.config/hd-home | |
sudo cp -r . /root/.config/hd-home | |
- name: Check basic installation | |
run: | | |
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | |
FILES=$(curl -s -X GET -G $URL | jq -r '.[] | .filename') | |
for file in $FILES | |
do | |
if [[ $file =~ ^config.* ]] && [[ $file =~ .*\.yml$ ]] ; then | |
sudo cat /root/.config/hd-home/$file | |
sudo hd install --accept-preRelease=true --force --fetch=false -t 8 $(echo -n $file | cut -c8- | rev | cut -c5- | rev) | |
if [[ $? != 0 ]]; then | |
exit 1 | |
fi | |
fi | |
done | |
# - name: Check install from source | |
# if: ${{ false }} | |
# run: | | |
# URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | |
# FILES=$(curl -s -X GET -G $URL | jq -r '.[] | .filename') | |
# for file in $FILES | |
# do | |
# if [[ $file =~ ^config.* ]] && [[ $file =~ .*\.yml$ ]] ; then | |
# fromSource=$(sudo cat /root/.config/hd-home/$file | grep fromSource) | |
# if [[ "$fromSource" == "fromSource: true" ]]; then | |
# hd install --accept-preRelease=true --fetch=false --from-source -t 8 $(echo -n $file | cut -c8- | rev | cut -c5- | rev) | |
# if [[ $? != 0 ]]; then | |
# exit 1 | |
# fi | |
# fi | |
# fi | |
# done |