aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/backport.yml26
-rw-r--r--.github/workflows/ci.yml (renamed from .github/workflows/test.yml)56
-rw-r--r--.github/workflows/hydra_status.yml16
3 files changed, 89 insertions, 9 deletions
diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml
new file mode 100644
index 000000000..ec7ab4516
--- /dev/null
+++ b/.github/workflows/backport.yml
@@ -0,0 +1,26 @@
+name: Backport
+on:
+ pull_request_target:
+ types: [closed, labeled]
+jobs:
+ backport:
+ name: Backport Pull Request
+ if: github.repository_owner == 'NixOS' && github.event.pull_request.merged == true && (github.event_name != 'labeled' || startsWith('backport', github.event.label.name))
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ # required to find all branches
+ fetch-depth: 0
+ - name: Create backport PRs
+ # should be kept in sync with `version`
+ uses: zeebe-io/backport-action@v0.0.7
+ with:
+ # Config README: https://github.com/zeebe-io/backport-action#backport-action
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ github_workspace: ${{ github.workspace }}
+ pull_description: |-
+ Bot-based backport to `${target_branch}`, triggered by a label in #${pull_number}.
+ # should be kept in sync with `uses`
+ version: v0.0.5
diff --git a/.github/workflows/test.yml b/.github/workflows/ci.yml
index abaff75ee..09436b7e3 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/ci.yml
@@ -1,20 +1,23 @@
-name: "Test"
+name: "CI"
+
on:
pull_request:
push:
+
jobs:
+
tests:
needs: [check_cachix]
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
-
+ timeout-minutes: 60
steps:
- - uses: actions/checkout@v2.3.4
+ - uses: actions/checkout@v2.4.0
with:
fetch-depth: 0
- - uses: cachix/install-nix-action@v14
+ - uses: cachix/install-nix-action@v16
- run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV
- uses: cachix/cachix-action@v10
if: needs.check_cachix.outputs.secret == 'true'
@@ -22,7 +25,8 @@ jobs:
name: '${{ env.CACHIX_NAME }}'
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- - run: nix-build -A checks.$(nix-instantiate --eval -E '(builtins.currentSystem)')
+ - run: nix --experimental-features 'nix-command flakes' flake check -L
+
check_cachix:
name: Cachix secret present for installer tests
runs-on: ubuntu-latest
@@ -34,6 +38,7 @@ jobs:
env:
_CACHIX_SECRETS: ${{ secrets.CACHIX_SIGNING_KEY }}${{ secrets.CACHIX_AUTH_TOKEN }}
run: echo "::set-output name=secret::${{ env._CACHIX_SECRETS != '' }}"
+
installer:
needs: [tests, check_cachix]
if: github.event_name == 'push' && needs.check_cachix.outputs.secret == 'true'
@@ -41,11 +46,11 @@ jobs:
outputs:
installerURL: ${{ steps.prepare-installer.outputs.installerURL }}
steps:
- - uses: actions/checkout@v2.3.4
+ - uses: actions/checkout@v2.4.0
with:
fetch-depth: 0
- run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV
- - uses: cachix/install-nix-action@v14
+ - uses: cachix/install-nix-action@v16
- uses: cachix/cachix-action@v10
with:
name: '${{ env.CACHIX_NAME }}'
@@ -53,6 +58,7 @@ jobs:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- id: prepare-installer
run: scripts/prepare-installer-for-github-actions
+
installer_test:
needs: [installer, check_cachix]
if: github.event_name == 'push' && needs.check_cachix.outputs.secret == 'true'
@@ -61,10 +67,42 @@ jobs:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/checkout@v2.3.4
+ - uses: actions/checkout@v2.4.0
- run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV
- - uses: cachix/install-nix-action@v14
+ - uses: cachix/install-nix-action@v16
with:
install_url: '${{needs.installer.outputs.installerURL}}'
install_options: "--tarball-url-prefix https://${{ env.CACHIX_NAME }}.cachix.org/serve"
- run: nix-instantiate -E 'builtins.currentTime' --eval
+
+ docker_push_image:
+ needs: [check_cachix, tests]
+ if: >-
+ github.event_name == 'push' &&
+ github.ref_name == 'master' &&
+ needs.check_cachix.outputs.secret == 'true'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2.4.0
+ with:
+ fetch-depth: 0
+ - uses: cachix/install-nix-action@v16
+ - run: echo CACHIX_NAME="$(echo $GITHUB_REPOSITORY-install-tests | tr "[A-Z]/" "[a-z]-")" >> $GITHUB_ENV
+ - run: echo NIX_VERSION="$(nix-instantiate --eval -E '(import ./default.nix).defaultPackage.${builtins.currentSystem}.version' | tr -d \")" >> $GITHUB_ENV
+ - uses: cachix/cachix-action@v10
+ if: needs.check_cachix.outputs.secret == 'true'
+ with:
+ name: '${{ env.CACHIX_NAME }}'
+ signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
+ authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
+ - run: nix --experimental-features 'nix-command flakes' build .#dockerImage -L
+ - run: docker load -i ./result/image.tar.gz
+ - run: docker tag nix:$NIX_VERSION nixos/nix:$NIX_VERSION
+ - run: docker tag nix:$NIX_VERSION nixos/nix:master
+ - name: Login to Docker Hub
+ uses: docker/login-action@v1
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+ - run: docker push nixos/nix:$NIX_VERSION
+ - run: docker push nixos/nix:master
diff --git a/.github/workflows/hydra_status.yml b/.github/workflows/hydra_status.yml
new file mode 100644
index 000000000..b97076bd7
--- /dev/null
+++ b/.github/workflows/hydra_status.yml
@@ -0,0 +1,16 @@
+name: Hydra status
+on:
+ schedule:
+ - cron: "12,42 * * * *"
+ workflow_dispatch:
+jobs:
+ check_hydra_status:
+ name: Check Hydra status
+ if: github.repository_owner == 'NixOS'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2.4.0
+ with:
+ fetch-depth: 0
+ - run: bash scripts/check-hydra-status.sh
+