diff options
author | Katharina Fey <kookie@spacekookie.de> | 2020-08-07 12:29:39 +0200 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2020-08-07 12:29:39 +0200 |
commit | 5581b5521e14317c3507a6e8451a3f14996e5c4d (patch) | |
tree | 7aadee5a9ef5d6e2acc8929818c6eb2d2099e2ae /nixpkgs/.github/workflows | |
parent | de94c6c62e2f86b3667386a42690d6bb376a2f58 (diff) | |
parent | 8e2b14aceb1d40c7e8b84c03a7c78955359872bb (diff) |
Merge commit '8e2b14aceb1d40c7e8b84c03a7c78955359872bb'
Diffstat (limited to 'nixpkgs/.github/workflows')
-rw-r--r-- | nixpkgs/.github/workflows/editorconfig.yml | 27 | ||||
-rw-r--r-- | nixpkgs/.github/workflows/wait-ofborg.yml | 36 |
2 files changed, 63 insertions, 0 deletions
diff --git a/nixpkgs/.github/workflows/editorconfig.yml b/nixpkgs/.github/workflows/editorconfig.yml new file mode 100644 index 00000000000..21532a0ded6 --- /dev/null +++ b/nixpkgs/.github/workflows/editorconfig.yml @@ -0,0 +1,27 @@ +name: "Checking EditorConfig" + +on: + pull_request: + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: technote-space/get-diff-action@v2.0.3 + - name: fetch editorconfig-checker + env: + VERSION: "2.1.0" + OS: "linux" + ARCH: "amd64" + ECC_URL: "https://github.com/editorconfig-checker/editorconfig-checker/releases/download" + run: | + curl -sSf -O -L -C - $ECC_URL/$VERSION/ec-$OS-$ARCH.tar.gz && \ + tar xzf ec-$OS-$ARCH.tar.gz && \ + mv ./bin/ec-$OS-$ARCH ./bin/editorconfig-checker + - name: Checking EditorConfig + run: | + ./bin/editorconfig-checker -disable-indentation \ + ${{ env.GIT_DIFF }} diff --git a/nixpkgs/.github/workflows/wait-ofborg.yml b/nixpkgs/.github/workflows/wait-ofborg.yml new file mode 100644 index 00000000000..3b40586fc27 --- /dev/null +++ b/nixpkgs/.github/workflows/wait-ofborg.yml @@ -0,0 +1,36 @@ +name: "Wait for ofborg" +on: + pull_request: +jobs: + tests: + runs-on: ubuntu-latest + steps: + - name: Wait for ofborg CI + run: | + # eval sometimes takes a bit longer on staging. + if [[ "$BASE_BRANCH" == "refs/heads/staging" ]]; then + COUNTDOWN=$((COUNTDOWN*2)) + fi + # ..in future a better fix would be to make ofborg mark CI as pending right away. + for i in $(seq "$COUNTDOWN"); do + res=$(curl --silent \ + -H "Accept: application/vnd.github.antiope-preview+json" \ + -H "Authorization: token ${GITHUB_TOKEN}" \ + "https://api.github.com/repos/NixOS/nixpkgs/commits/${COMMIT}/check-runs" | \ + jq ".check_runs | map(.app) | map(.id) | contains([${OFBORG_APP_ID}])") + if [[ "$res" == "true" ]]; then + exit 0 + fi + sleep 5 + echo "." + done + echo "Timeout!" + exit 1 + # ofborg is not checking forks. + if: github.repository_owner == 'NixOS' + env: + BASE_BRANCH: ${{ github.base_ref }} + COUNTDOWN: 360 # wait for ~30min... + GITHUB_TOKEN: ${{ github.token }} + COMMIT: ${{ github.event.pull_request.head.sha }} + OFBORG_APP_ID: 20500 |