From c50441d48fea1e53870e5225d18fd4e5f554e219 Mon Sep 17 00:00:00 2001 From: Akuli Date: Fri, 24 Feb 2023 22:58:09 +0200 Subject: [PATCH] Make indentation of yaml files consistent (#231) --- .github/workflows/linux.yml | 28 ++++---- .github/workflows/release.yml | 132 +++++++++++++++++----------------- 2 files changed, 80 insertions(+), 80 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 9486d398..4c9dcb7a 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -13,17 +13,17 @@ jobs: # Testing all levels because there was a bug that only happened with -O1. (#224) opt-level: ['-O0', '-O1', '-O2', '-O3'] steps: - - uses: actions/checkout@v3 - - run: sudo apt install -y llvm-${{ matrix.llvm-version }}-dev clang-${{ matrix.llvm-version }} make valgrind - - run: LLVM_CONFIG=llvm-config-${{ matrix.llvm-version }} make - - run: ./runtests.sh --verbose './jou ${{ matrix.opt-level }} %s' - - run: ./runtests.sh --verbose './jou ${{ matrix.opt-level }} --verbose %s' - - run: ./runtests.sh --verbose --valgrind './jou ${{ matrix.opt-level }} %s' - # valgrind+verbose isn't meaningful: test script would ignore valgrind output - - run: make clean - - name: Check that "make clean" deleted all files not committed to Git - run: | - if [ "$(git status --porcelain --ignored)" != "" ]; then - git status --ignored - exit 1 - fi + - uses: actions/checkout@v3 + - run: sudo apt install -y llvm-${{ matrix.llvm-version }}-dev clang-${{ matrix.llvm-version }} make valgrind + - run: LLVM_CONFIG=llvm-config-${{ matrix.llvm-version }} make + - run: ./runtests.sh --verbose './jou ${{ matrix.opt-level }} %s' + - run: ./runtests.sh --verbose './jou ${{ matrix.opt-level }} --verbose %s' + - run: ./runtests.sh --verbose --valgrind './jou ${{ matrix.opt-level }} %s' + # valgrind+verbose isn't meaningful: test script would ignore valgrind output + - run: make clean + - name: Check that "make clean" deleted all files not committed to Git + run: | + if [ "$(git status --porcelain --ignored)" != "" ]; then + git status --ignored + exit 1 + fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 265f8d1d..003bba28 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,76 +14,76 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - run: git fetch --tags - - id: tagname - run: | - if git tag -l --contains HEAD | grep .; then - # Commit already tagged - echo datetag= >> $GITHUB_OUTPUT - else - echo datetag=$(date +'%Y-%m-%d-%H00') > $GITHUB_OUTPUT - fi - - if: ${{ steps.tagname.outputs.datetag != '' }} - name: Download latest GitHub actions build results - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const fs = require('fs'); + - uses: actions/checkout@v3 + - run: git fetch --tags + - id: tagname + run: | + if git tag -l --contains HEAD | grep .; then + # Commit already tagged + echo datetag= >> $GITHUB_OUTPUT + else + echo datetag=$(date +'%Y-%m-%d-%H00') > $GITHUB_OUTPUT + fi + - if: ${{ steps.tagname.outputs.datetag != '' }} + name: Download latest GitHub actions build results + uses: actions/github-script@v6 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + const fs = require('fs'); - // Based on: https://github.com/python/typeshed/blob/82fa8473ffddc57a53b4dbcb1063aa2e66352ca9/.github/workflows/mypy_primer_comment.yml - const allRuns = ( - await github.rest.actions.listWorkflowRunsForRepo({ - owner: context.repo.owner, - repo: context.repo.repo, - branch: 'main', - }) - ).data.workflow_runs; - console.log(`Found ${allRuns.length} runs`); - console.log(allRuns.map(r => r.name)); - const run = allRuns - .filter(r => r.name === '.github/workflows/windows.yml') - .sort((a, b) => (+new Date(b.run_started_at)) - (+new Date(a.run_started_at)))[0]; + // Based on: https://github.com/python/typeshed/blob/82fa8473ffddc57a53b4dbcb1063aa2e66352ca9/.github/workflows/mypy_primer_comment.yml + const allRuns = ( + await github.rest.actions.listWorkflowRunsForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + branch: 'main', + }) + ).data.workflow_runs; + console.log(`Found ${allRuns.length} runs`); + console.log(allRuns.map(r => r.name)); + const run = allRuns + .filter(r => r.name === '.github/workflows/windows.yml') + .sort((a, b) => (+new Date(b.run_started_at)) - (+new Date(a.run_started_at)))[0]; - const allArtifacts = ( - await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: run.id, - }) - ).data.artifacts; - console.log(`Found ${allArtifacts.length} artifacts`); - console.log(allArtifacts.map(a => a.name)); - const artifact = allArtifacts.filter(a => a.name === 'windows-zip')[0]; + const allArtifacts = ( + await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: run.id, + }) + ).data.artifacts; + console.log(`Found ${allArtifacts.length} artifacts`); + console.log(allArtifacts.map(a => a.name)); + const artifact = allArtifacts.filter(a => a.name === 'windows-zip')[0]; - const zip = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: artifact.id, - archive_format: 'zip', - }); + const zip = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: artifact.id, + archive_format: 'zip', + }); - // https://stackoverflow.com/a/46779188 - fs.writeFileSync("nested-zip-file.zip", Buffer.from(zip.data)); + // https://stackoverflow.com/a/46779188 + fs.writeFileSync("nested-zip-file.zip", Buffer.from(zip.data)); - # We get a zip file inside a zip file: - # * Inner zip file: The build creates a releasing-ready zip file. This is - # good because you can test the zip file before Jou is released. - # * Outer zip file: It is possible to include multiple files to the same - # GitHub Actions artifact, and downloadArtifact() gives a zip of all - # files that the artifact consists of. - - if: ${{ steps.tagname.outputs.datetag != '' }} - run: unzip nested-zip-file.zip + # We get a zip file inside a zip file: + # * Inner zip file: The build creates a releasing-ready zip file. This is + # good because you can test the zip file before Jou is released. + # * Outer zip file: It is possible to include multiple files to the same + # GitHub Actions artifact, and downloadArtifact() gives a zip of all + # files that the artifact consists of. + - if: ${{ steps.tagname.outputs.datetag != '' }} + run: unzip nested-zip-file.zip - - if: ${{ steps.tagname.outputs.datetag != '' }} - run: mv jou.zip jou_windows_64bit_${{ steps.tagname.outputs.datetag }}.zip + - if: ${{ steps.tagname.outputs.datetag != '' }} + run: mv jou.zip jou_windows_64bit_${{ steps.tagname.outputs.datetag }}.zip - - if: ${{ steps.tagname.outputs.datetag != '' }} - name: Create release - uses: ncipollo/release-action@v1 - with: - commit: main - tag: ${{ steps.tagname.outputs.datetag }} - artifacts: jou_windows_64bit_${{ steps.tagname.outputs.datetag }}.zip - skipIfReleaseExists: true + - if: ${{ steps.tagname.outputs.datetag != '' }} + name: Create release + uses: ncipollo/release-action@v1 + with: + commit: main + tag: ${{ steps.tagname.outputs.datetag }} + artifacts: jou_windows_64bit_${{ steps.tagname.outputs.datetag }}.zip + skipIfReleaseExists: true