Skip to content

CI

CI #493

Workflow file for this run

name: CI
on:
push:
branches: [main]
paths-ignore: ['**.md']
pull_request:
branches: [main]
paths-ignore: ['**.md']
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
ci:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
# Permissions required to delete previous workflow runs
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication
permissions:
actions: write
defaults:
run:
shell: bash
env:
ENV_VAR0: 'env_val0'
ENV_VAR1: 'env_val1'
ENV_VAR2: 'env_val2'
ENV_VAR3: 'env_val3'
ENV_VAR4: 'env_val4'
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
- name: Delete previous scheduled runs except the last one from Linux runner
if: ${{ runner.os == 'Linux' && github.event_name == 'schedule' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for rid in $(gh run list --json databaseId --jq '.[] | join("")' | tail -n +2); do
gh run delete "$rid";
done
- name: 'Run {enable-in-place: false, enable-dump: true}'
uses: ./
with:
env-files: |
test/test.env
input-files: |
test/test.json
test/test.yaml
enable-in-place: false
enable-dump: true
- name: 'Verify {enable-in-place: false, enable-dump: true}'
run: |
diff test/test.json.env test/expected/test.json
diff test/test.yaml.env test/expected/test.yaml
git restore .
- name: 'Run {enable-in-place: true, enable-dump: true}'
uses: ./
with:
env-files: |
test/test.env
input-files: |
test/test.json
test/test.yaml
enable-in-place: true
enable-dump: true
- name: 'Verify {enable-in-place: true, enable-dump: true}'
run: |
diff test/test.json test/expected/test.json
diff test/test.yaml test/expected/test.yaml
git restore .
- name: 'Run {variables, enable-in-place: false, enable-dump: true}'
uses: ./
with:
env-files: |
test/test.env
input-files: |
test/test.json
test/test.yaml
variables: |
ENV_VAR0
ENV_VAR1
enable-in-place: false
enable-dump: true
- name: 'Verify {variables, enable-in-place: false, enable-dump: true}'
run: |
diff test/test.json.env test/expected/test-variables.json
diff test/test.yaml.env test/expected/test-variables.yaml
git restore .
- name: 'Run {prefixes, enable-in-place: false, enable-dump: true}'
uses: ./
with:
env-files: |
test/test.env
input-files: |
test/test.json
test/test.yaml
prefixes: |
ENV
enable-in-place: false
enable-dump: true
- name: 'Verify {prefixes, enable-in-place: false, enable-dump: true}'
run: |
diff test/test.json.env test/expected/test-prefixes.json
diff test/test.yaml.env test/expected/test-prefixes.yaml
git restore .
- name: 'Run {output-directory, enable-in-place: false, enable-dump: true}'
uses: ./
with:
env-files: |
test/test.env
input-files: |
test/test.json
test/test.yaml
output-directory: ./output
enable-in-place: false
enable-dump: true
- name: 'Run {variables, prefixes, enable-in-place: false, enable-dump: true}'
uses: ./
with:
env-files: |
test/test.env
input-files: |
test/test.json
test/test.yaml
variables: |
TEST_VAR0
TEST_VAR1
prefixes: |
ENV
enable-in-place: false
enable-dump: true
- name: 'Verify {variables, prefixes, enable-in-place: false, enable-dump: true}'
run: |
diff test/test.json.env test/expected/test-variables-prefixes.json
diff test/test.yaml.env test/expected/test-variables-prefixes.yaml
git restore .
- name: 'Run {output-directory, enable-in-place: false, enable-dump: true}'
uses: ./
with:
env-files: |
test/test.env
input-files: |
test/test.json
test/test.yaml
output-directory: ./output
enable-in-place: false
enable-dump: true
- name: 'Verify {output-directory, enable-in-place: false, enable-dump: true}'
run: |
diff output/test.json.env test/expected/test.json
diff output/test.yaml.env test/expected/test.yaml
git restore .