mirror of
https://github.com/outbackdingo/cozystack.git
synced 2026-03-20 09:41:04 +00:00
93 lines
2.7 KiB
YAML
93 lines
2.7 KiB
YAML
name: Pull Request
|
|
|
|
on:
|
|
pull_request:
|
|
types: [labeled, opened, synchronize, reopened]
|
|
|
|
concurrency:
|
|
group: pull-requests-${{ github.workflow }}-${{ github.event.pull_request.number }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: [oracle-4cpu-16gb-x86-64]
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
# Never run when the PR carries the "release" label.
|
|
if: |
|
|
!contains(github.event.pull_request.labels.*.name, 'release')
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
registry: ghcr.io
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
set -e
|
|
sudo mkdir -p -m 755 /etc/apt/keyrings
|
|
sudo wget -O /etc/apt/keyrings/githubcli-archive-keyring.gpg https://cli.github.com/packages/githubcli-archive-keyring.gpg
|
|
sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
|
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
|
|
sudo apt update
|
|
sudo apt install -y jq skopeo gh gawk
|
|
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
|
|
sudo chmod +x /usr/local/bin/yq
|
|
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | sudo bash
|
|
sudo modprobe loop
|
|
|
|
- name: Build
|
|
run: make build
|
|
|
|
- name: Build Talos image
|
|
run: make -C packages/core/installer talos-nocloud
|
|
|
|
- name: Upload installer
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: cozystack-installer
|
|
path: _out/assets/cozystack-installer.yaml
|
|
|
|
- name: Upload Talos image
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: talos-image
|
|
path: _out/assets/nocloud-amd64.raw.xz
|
|
|
|
test:
|
|
name: Test
|
|
runs-on: [self-hosted]
|
|
needs: build
|
|
|
|
# Never run when the PR carries the "release" label.
|
|
if: |
|
|
!contains(github.event.pull_request.labels.*.name, 'release')
|
|
|
|
steps:
|
|
- name: Download installer
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: cozystack-installer
|
|
path: _out/assets/
|
|
|
|
- name: Download Talos image
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: talos-image
|
|
path: _out/assets/
|
|
|
|
- name: Test
|
|
run: make test
|