Skip to content

Commit

Permalink
Attempt to add checks for pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenvh1 committed Jan 6, 2025
1 parent b01dffc commit d74e6ec
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 21 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Check files syntactically valid

on:
pull_request:
branches: ["master"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check whether city files are valid
uses: ali-kamalizade/[email protected]
with:
directory: 'web/cities'
ecmaVersion: 'es5'
files: '*.js'
- name: Check whether station files are valid
uses: ali-kamalizade/[email protected]
with:
directory: 'web/stations'
ecmaVersion: 'es5'
files: '*.js'
- name: Check whether European station logos are present
uses: actions/github-script@v7
with:
script: |
const fs = require("fs");
let stationsFile = fs.readFileSync("web/stations/stations-europe.js", "utf8");
fs.writeFileSync("stations-europe-module.js", stationsFile + "\nexports.stations = stations;");
let stations = require("./stations-europe-module.js")
let failed = false;
for (const [key, value] of Object.entries(stations.stations)) {
for (const elem of value) {
if (!fs.existsSync("web/" + elem["logo"])) {
console.error(elem["logo"] + " missing!");
failed = true;
}
}
}
if (failed) {
process.exit(1);
}
- name: Check whether American station logos are present
uses: actions/github-script@v7
with:
script: |
const fs = require("fs");
let stationsFile = fs.readFileSync("web/stations/stations-america.js", "utf8");
fs.writeFileSync("stations-america-module.js", stationsFile + "\nexports.stations = stations;");
let stations = require("./stations-america-module.js")
let failed = false;
for (const [key, value] of Object.entries(stations.stations)) {
for (const elem of value) {
if (!fs.existsSync("web/" + elem["logo"])) {
console.error(elem["logo"] + " missing!");
failed = true;
}
}
}
if (failed) {
process.exit(1);
}
21 changes: 0 additions & 21 deletions web/stations/stations-america.js
Original file line number Diff line number Diff line change
Expand Up @@ -26789,9 +26789,6 @@ var stations = {
url: "http://216.251.79.148:8000/;stream"
},
],
};

var stations_mexico = {
"acaponeta": [
{
name: "La Patrona 92.5",
Expand Down Expand Up @@ -29340,9 +29337,6 @@ var stations_mexico = {
url: "https://cast.zuperdns.net/8020/stream"
},
],
};

var stations_c2c = {
"anniston_al": [
{
name: "Grace Radio 90.7",
Expand Down Expand Up @@ -53262,9 +53256,6 @@ var stations_c2c = {
url: "https://ice24.securenetsystems.net/WXCO"
},
],
};

var stations_canada = {
"baiecomeau": [
{
name: "CBC Radio One 93.7 FM",
Expand Down Expand Up @@ -57622,9 +57613,6 @@ var stations_canada = {
url: "https://stream2.statsradio.com:8046/stream"
},
],
};

var stations_caribbean = {
"adicora": [
{
name: "Canal 90",
Expand Down Expand Up @@ -58678,9 +58666,6 @@ var stations_caribbean = {
url: "http://znsradiogroup.streamcomedia.com:9788/zns1540am"
},
],
};

var stations_alaska = {
"alcan": [
{
name: "No stations in this area",
Expand Down Expand Up @@ -59138,9 +59123,3 @@ var stations_alaska = {
},
],
};

stations = $.extend(stations, stations_mexico);
stations = $.extend(stations, stations_c2c);
stations = $.extend(stations, stations_canada);
stations = $.extend(stations, stations_caribbean);
stations = $.extend(stations, stations_alaska);

0 comments on commit d74e6ec

Please sign in to comment.