feat: add comment-or-create action #267
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test-composite | |
on: | |
push: | |
branches: [ master, main ] | |
pull_request: | |
schedule: | |
- cron: "0 0 * * Mon" # once a week https://crontab.guru/#0_0_*_* | |
concurrency: | |
group: '${{ github.workflow }}-${{ github.head_ref || github.ref_name }}' | |
cancel-in-progress: true | |
jobs: | |
test-scripts: | |
name: Test scripts | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
experimental: [ false ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
- run: ./gemver-to-semver.rb --self-test | |
test-composite: | |
name: Test composite actions ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
experimental: [ false ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./graphviz-setup-action | |
- run: dot -V | |
- uses: ./inkscape-setup-action | |
- run: inkscape --version | |
- uses: ./libreoffice-setup-action | |
- if: matrix.os != 'macos-latest' | |
run: soffice --version | |
- uses: ./plantuml-setup-action | |
- run: plantuml -version | |
test-native-deps-action: | |
name: Test native-deps-action ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
library: /usr/bin/login | |
- os: windows-latest | |
library: C:\WINDOWS\System32\KERNELBASE.dll | |
- os: macos-latest | |
library: /usr/bin/login | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./native-deps-action | |
with: | |
filepath: ${{ matrix.library }} | |
test-bundler-docker-gh-rubygem-setup-action: | |
name: Test gh-rubygems-setup-action & docker-gem-install in docker | |
runs-on: ubuntu-latest | |
container: docker://metanorma/metanorma | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./gh-rubygems-setup-action | |
with: | |
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }} | |
- run: | | |
echo 'gem "metanorma-cli"' > Gemfile | |
echo 'gem "metanorma", "~>1"' >> Gemfile | |
echo 'gem "metanorma-nist", source: "https://rubygems.pkg.github.com/metanorma"' >> Gemfile | |
echo 'gem "metanorma-standoc", git: "https://github.com/metanorma/metanorma-standoc", branch: "main"' >> Gemfile | |
- run: apt-get update -y && apt-get install -y gcc g++ ruby-dev | |
- uses: ./docker-gem-install | |
test-gem-docker-gh-rubygem-setup-action: | |
name: Test gh-rubygems-setup-action & docker-gem-install in docker | |
runs-on: ubuntu-latest | |
container: | |
image: metanorma/metanorma:ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./gh-rubygems-setup-action | |
with: | |
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }} | |
- shell: bash | |
run: | | |
for gem in metanorma-cli metanorma-nist; do | |
[[ "$(gem info --remote $gem)" =~ "$gem" ]] || (echo "Error gem '$gem' not found" && exit 1) | |
done | |
test-bundler-gh-rubygem-setup-action: | |
name: Test gh-rubygems-setup-action | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
- uses: ./gh-rubygems-setup-action | |
with: | |
token: dummy_token | |
- uses: chrisdickinson/setup-yq@latest | |
with: | |
yq-version: v4.30.4 | |
- run: | | |
yq -e e '.["BUNDLE_HTTPS://RUBYGEMS__PKG__GITHUB__COM/METANORMA/"] == "x-access-token:dummy_token"' ~/.bundle/config | |
yq -e e '.[":sources"] | length == 2' ~/.gemrc | |
- run: | | |
env | |
[ ${BUNDLE_GITHUB__COM} = "x-access-token:dummy_token" ] || exit 1 | |
[ ${BUNDLE_RUBYGEMS__PKG__GITHUB__COM} = "x-access-token:dummy_token" ] || exit 1 | |
test-latexml-setup-action: | |
name: Test latexml-setup-action ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./latexml-setup-action | |
- run: latexmlmath --VERSION | |
test-change-tmpdir-action: | |
name: Test change-tmpdir-action ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./change-tmpdir-action | |
with: | |
tmpdir: ${{ github.workspace }}/tmp | |
- run: env | |
shell: bash | |
test-xml2rfc-action: | |
name: Test xml2rfc-setup-action ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./xml2rfc-setup-action | |
- run: xml2rfc --version | |
test-ghostscript-action: | |
name: Test ghostscript-setup-action ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ghostscript-setup-action | |
- if: matrix.os != 'windows-latest' | |
run: gs --version | |
- if: matrix.os == 'windows-latest' | |
run: gswin64c.exe --version | |
test-fontist-action: | |
name: Test fontist-setup-action ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
max-parallel: 5 | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
force-install: [false, true] | |
private-fonts-pat: [ 'y', 'n' ] | |
include: | |
- os: windows-latest | |
force-install: false | |
private-fonts-pat: 'y' | |
steps: | |
- uses: actions/checkout@v4 | |
- if: ${{ !matrix.force-install }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
- uses: ./fontist-setup | |
with: | |
force-install: ${{ matrix.force-install }} | |
private-fonts-pat: ${{ matrix.private-fonts-pat == 'y' && secrets.METANORMA_CI_PAT_TOKEN || '' }} | |
- run: fontist help || [ $? -eq 1 ] | |
shell: bash | |
test-gh-pages-status-action: | |
name: Test gh-pages-status-action ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
max-parallel: 5 | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
force-install: [false, true] | |
include: | |
- os: windows-latest | |
force-install: false | |
steps: | |
- uses: actions/checkout@v4 | |
- id: gh-pages-status | |
uses: ./gh-pages-status-action | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
gh-force-install: ${{ matrix.force-install }} | |
- run: | | |
[ ${{ steps.gh-pages-status.outputs.enabled }} = "false" ] | |
shell: bash | |
test-docker-gh-pages-status-action: | |
name: Test gh-pages-status-action on docker | |
runs-on: ubuntu-latest | |
container: docker://metanorma/metanorma | |
strategy: | |
fail-fast: false | |
matrix: | |
force-install: [false, true] | |
steps: | |
- uses: actions/checkout@v4 | |
- id: gh-pages-status | |
uses: ./gh-pages-status-action | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
gh-force-install: ${{ matrix.force-install }} | |
- run: | | |
[ ${{ steps.gh-pages-status.outputs.enabled }} = "false" ] | |
shell: bash | |
test-gh-repo-status-action: | |
name: Test gh-repo-status-action ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
max-parallel: 5 | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
repository: [''] | |
result: [true] | |
include: | |
- os: ubuntu-latest | |
repository: 'metanorma/metanorma-docker-private' | |
result: false | |
- os: macos-latest | |
repository: 'metanorma/metanorma-docker-private' | |
result: false | |
- os: windows-latest | |
repository: 'metanorma/metanorma-docker-private' | |
result: false | |
steps: | |
- uses: actions/checkout@v4 | |
- id: gh-repo-status | |
uses: ./gh-repo-status-action | |
with: | |
repository: ${{ matrix.repository }} | |
- run: | | |
[ ${{ steps.gh-repo-status.outputs.public }} = "${{ matrix.result }}" ] | |
shell: bash | |
test-dive-action: | |
name: Test dive-action ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] # macos-latest - no docker installed , windows-latest - no experimental options enabled by default | |
steps: | |
- uses: actions/checkout@v4 | |
- shell: bash | |
run: | | |
cat > Dockerfile << EOF | |
FROM alpine:latest | |
CMD ["echo", "'Hello World!'"] | |
EOF | |
docker build . -t ci-test-image --platform=linux/amd64 | |
- uses: ./dive-action | |
with: | |
image: docker.io/library/ci-test-image | |
test-choco-cache-action: | |
name: Test choco-cache-action | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./choco-cache-action | |
- run: | | |
choco install 7zip | |
gc C:\ProgramData\chocolatey\logs\chocolatey.log |