Skip to content

Commit

Permalink
Make indentation of yaml files consistent (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli authored Feb 24, 2023
1 parent 39af4f4 commit c50441d
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 80 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
132 changes: 66 additions & 66 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c50441d

Please sign in to comment.